diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/indent/php/property-hooks.php | 13 | ||||
| -rw-r--r-- | tests/indent/php_spec.lua | 5 | ||||
| -rw-r--r-- | tests/query/highlights/php/keywords.php | 35 |
3 files changed, 53 insertions, 0 deletions
diff --git a/tests/indent/php/property-hooks.php b/tests/indent/php/property-hooks.php new file mode 100644 index 000000000..e4aea4fdd --- /dev/null +++ b/tests/indent/php/property-hooks.php @@ -0,0 +1,13 @@ +<?php + +class Foo +{ + private string $_baz; + + public string $baz { + &get => $this->_baz; + set { + $this->_baz = strtoupper($value); + } + } +} diff --git a/tests/indent/php_spec.lua b/tests/indent/php_spec.lua index 2a41079ff..c3f84e6e2 100644 --- a/tests/indent/php_spec.lua +++ b/tests/indent/php_spec.lua @@ -67,5 +67,10 @@ describe("indent PHP:", function() run:new_line("issue-6888.php", { on_line = 6, text = "$a;", indent = 0 }) run:new_line("issue-6888.php", { on_line = 8, text = "$a;", indent = 4 }) run:new_line("issue-6888.php", { on_line = 11, text = "$a;", indent = 0 }) + run:new_line("property-hooks.php", { on_line = 7, text = "get;", indent = 8 }) + run:new_line("property-hooks.php", { on_line = 8, text = "set;", indent = 8 }) + run:new_line("property-hooks.php", { on_line = 9, text = "$a;", indent = 12 }) + run:new_line("property-hooks.php", { on_line = 11, text = "get;", indent = 8 }) + run:new_line("property-hooks.php", { on_line = 12, text = "get;", indent = 4 }) end) end) diff --git a/tests/query/highlights/php/keywords.php b/tests/query/highlights/php/keywords.php index f3d3f95a7..6b938c43f 100644 --- a/tests/query/highlights/php/keywords.php +++ b/tests/query/highlights/php/keywords.php @@ -1,5 +1,40 @@ <?php +namespace Foo\Bar; +//^^^^^^^ @keyword.type +// ^^^ @module +// ^^^ @module + +use Foo\Baz as Baaz; +//^ @keyword.import +// ^^^ @module +// ^^^ @type +// ^^ @keyword.operator +// ^^^^ @type.definition + +use function Foo\foo as fooo; +// ^^^^^^^^ @keyword.function +// ^^^ @function +// ^^^^ @function + +use const Foo\FOO as FOOO; +// ^^^^^ @keyword.modifier +// ^^^ @constant +// ^^^^ @constant + +use Foo\Baz\{ +// ^^^ @module +// ^^^ @module + Bar, +//^^^ @type + function foo, +//^^^^^^^^ @keyword.function +// ^^^ @function + const FOO, +//^^^^^ @keyword.modifier +// ^^^ @constant +}; + abstract class A { protected readonly static $a; |
