-
-
Notifications
You must be signed in to change notification settings - Fork 275
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support fo " use function" statements
- Loading branch information
1 parent
47c763b
commit 87a137a
Showing
5 changed files
with
61 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,28 @@ | ||
import { PHP_FUNC } from '@octolinker/helper-grammar-regex-collection'; | ||
import php from '../index'; | ||
|
||
describe('rust-crate', () => { | ||
const path = '/blob/path/dummy'; | ||
|
||
it('resolves php using the live-resolver', () => { | ||
expect(php.resolve(path, ['ArrayAccess'])).toEqual({ | ||
it('resolves classes', () => { | ||
expect(php.resolve(path, ['FooBar'])).toEqual({ | ||
registry: 'ping', | ||
target: 'https://www.php.net/manual/en/class.arrayaccess.php', | ||
target: 'https://www.php.net/manual/en/class.foobar.php', | ||
}); | ||
}); | ||
|
||
it('resolves functions', () => { | ||
expect(php.resolve(path, ['Foo_Bar'], {}, PHP_FUNC)).toEqual({ | ||
registry: 'ping', | ||
target: 'https://www.php.net/manual/en/function.foo-bar.php', | ||
}); | ||
}); | ||
|
||
it('does not try to resolve packages', () => { | ||
expect( | ||
php.resolve(path, [ | ||
'Illuminate\\Contracts\\Container\\BindingResolutionException', | ||
]), | ||
).toEqual(undefined); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters