From 856afe1ec5107fa90429345c8e9462639193be0e Mon Sep 17 00:00:00 2001 From: Dorian Villet Date: Tue, 31 Dec 2019 00:12:33 +0100 Subject: [PATCH] [Php71] Add failing test case for CountOnNullRector. --- .../skip_countable_local_property.php.inc | 2 +- .../skip_countable_remote_property.php.inc | 20 +++++++++++++++++++ .../Source/ClassWithCountableProperty.php | 13 ++++++++++++ 3 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 packages/Php71/tests/Rector/FuncCall/CountOnNullRector/Fixture/skip_countable_remote_property.php.inc create mode 100644 packages/Php71/tests/Rector/FuncCall/CountOnNullRector/Source/ClassWithCountableProperty.php diff --git a/packages/Php71/tests/Rector/FuncCall/CountOnNullRector/Fixture/skip_countable_local_property.php.inc b/packages/Php71/tests/Rector/FuncCall/CountOnNullRector/Fixture/skip_countable_local_property.php.inc index 21d0ab297af7..1d6bd8365a80 100644 --- a/packages/Php71/tests/Rector/FuncCall/CountOnNullRector/Fixture/skip_countable_local_property.php.inc +++ b/packages/Php71/tests/Rector/FuncCall/CountOnNullRector/Fixture/skip_countable_local_property.php.inc @@ -2,7 +2,7 @@ namespace Rector\Php71\Tests\Rector\FuncCall\CountOnNullRector\Fixture; -final class SkipCountableTypeProperty +final class SkipCountableLocalProperty { private $titles = []; diff --git a/packages/Php71/tests/Rector/FuncCall/CountOnNullRector/Fixture/skip_countable_remote_property.php.inc b/packages/Php71/tests/Rector/FuncCall/CountOnNullRector/Fixture/skip_countable_remote_property.php.inc new file mode 100644 index 000000000000..7e58c01f0fab --- /dev/null +++ b/packages/Php71/tests/Rector/FuncCall/CountOnNullRector/Fixture/skip_countable_remote_property.php.inc @@ -0,0 +1,20 @@ +remote = new ClassWithCountableProperty(); + } + + public function getTitle() + { + count($this->remote->countable); + } +} diff --git a/packages/Php71/tests/Rector/FuncCall/CountOnNullRector/Source/ClassWithCountableProperty.php b/packages/Php71/tests/Rector/FuncCall/CountOnNullRector/Source/ClassWithCountableProperty.php new file mode 100644 index 000000000000..cfb096ccccfc --- /dev/null +++ b/packages/Php71/tests/Rector/FuncCall/CountOnNullRector/Source/ClassWithCountableProperty.php @@ -0,0 +1,13 @@ +