Pastakhov has submitted this change and it was merged. Change subject: Fix tests, ignore object tests when enterance point is not PhpTags ......................................................................
Fix tests, ignore object tests when enterance point is not PhpTags Change-Id: I18b5d0ebaef21d9d6f86d9c124e44e513411ee59 (cherry picked from commit 90e8bb90dc9f490bd92c8c0c26bd758eb384ac74) --- M tests/phpunit/includes/RuntimeTest.php 1 file changed, 128 insertions(+), 1 deletion(-) Approvals: Pastakhov: Verified; Looks good to me, approved diff --git a/tests/phpunit/includes/RuntimeTest.php b/tests/phpunit/includes/RuntimeTest.php index e5fb022..7a6129d 100644 --- a/tests/phpunit/includes/RuntimeTest.php +++ b/tests/phpunit/includes/RuntimeTest.php @@ -3734,6 +3734,10 @@ } public function testRun_object_operation_test_1() { + if ( !defined( 'PHPTAGS_TEST' ) ) { + return; + } + $this->assertEquals( Runtime::runSource( '$foo=["rrr"]; $bar=new PhpTagsTest(); $foo = $foo . $bar; echo $foo[0],$bar;', array('test'), 77777 ), array( @@ -3743,6 +3747,10 @@ ); } public function testRun_object_operation_test_2() { + if ( !defined( 'PHPTAGS_TEST' ) ) { + return; + } + $this->assertEquals( Runtime::runSource( '$foo=["rrr"]; $bar=new PhpTagsTest(); $foo = $foo + $bar; echo $foo,$bar;', array('test'), 77777 ), array( @@ -3752,6 +3760,10 @@ ); } public function testRun_object_operation_test_3() { + if ( !defined( 'PHPTAGS_TEST' ) ) { + return; + } + $this->assertEquals( Runtime::runSource( '$foo=new PhpTagsTest(); $bar=["rrr"]; $foo += $bar; echo $foo,$bar;', array('test'), 77777 ), array( @@ -3761,6 +3773,10 @@ ); } public function testRun_object_operation_test_4() { + if ( !defined( 'PHPTAGS_TEST' ) ) { + return; + } + $this->assertEquals( Runtime::runSource( '$foo=new PhpTagsTest(); $bar=5; $foo = $bar + $foo; echo $foo,$bar;', array('test'), 77777 ), array( @@ -3771,6 +3787,10 @@ ); } public function testRun_object_operation_test_5() { + if ( !defined( 'PHPTAGS_TEST' ) ) { + return; + } + $this->assertEquals( Runtime::runSource( '$foo=new PhpTagsTest(); $bar=5; $foo = $bar - $foo; echo $foo,$bar;', array('test'), 77777 ), array( @@ -3781,6 +3801,10 @@ ); } public function testRun_object_operation_test_6() { + if ( !defined( 'PHPTAGS_TEST' ) ) { + return; + } + $this->assertEquals( Runtime::runSource( '$foo=new PhpTagsTest(); $bar=5; $foo -= $bar; echo $foo,$bar;', array('test'), 77777 ), array( @@ -3791,6 +3815,10 @@ ); } public function testRun_object_operation_test_7() { + if ( !defined( 'PHPTAGS_TEST' ) ) { + return; + } + $this->assertEquals( Runtime::runSource( '$foo=new PhpTagsTest(); $bar=5; $foo = $foo > $bar; echo $foo,$bar;', array('test'), 77777 ), array( @@ -3801,6 +3829,10 @@ ); } public function testRun_object_operation_test_8() { + if ( !defined( 'PHPTAGS_TEST' ) ) { + return; + } + $this->assertEquals( Runtime::runSource( '$foo=new PhpTagsTest(); $bar=5; $foo = $foo < $bar; echo $foo,$bar;', array('test'), 77777 ), array( @@ -3811,6 +3843,10 @@ ); } public function testRun_object_operation_test_9() { + if ( !defined( 'PHPTAGS_TEST' ) ) { + return; + } + $this->assertEquals( Runtime::runSource( '$foo=new PhpTagsTest(); $bar=5; $foo = $bar <= $foo; echo $foo,$bar;', array('test'), 77777 ), array( @@ -3821,6 +3857,10 @@ ); } public function testRun_object_operation_test_10() { + if ( !defined( 'PHPTAGS_TEST' ) ) { + return; + } + $this->assertEquals( Runtime::runSource( '$foo=new PhpTagsTest(); $bar=5; $foo = $bar >= $foo; echo $foo,$bar;', array('test'), 77777 ), array( @@ -3831,6 +3871,10 @@ ); } public function testRun_object_operation_test_11() { + if ( !defined( 'PHPTAGS_TEST' ) ) { + return; + } + $this->assertEquals( Runtime::runSource( '$foo=new PhpTagsTest(); $bar=5; $foo = $bar == $foo; echo $foo,$bar;', array('test'), 77777 ), array( @@ -3841,6 +3885,10 @@ ); } public function testRun_object_operation_test_12() { + if ( !defined( 'PHPTAGS_TEST' ) ) { + return; + } + $this->assertEquals( Runtime::runSource( '$foo=new PhpTagsTest(); $bar=5; $foo = $bar != $foo; echo $foo,$bar;', array('test'), 77777 ), array( @@ -3851,6 +3899,10 @@ ); } public function testRun_object_operation_test_13() { + if ( !defined( 'PHPTAGS_TEST' ) ) { + return; + } + $this->assertEquals( Runtime::runSource( '$foo=new PhpTagsTest(); $bar=5; $foo = $bar === $foo; echo $foo,$bar;', array('test'), 77777 ), array( @@ -3860,6 +3912,10 @@ ); } public function testRun_object_operation_test_14() { + if ( !defined( 'PHPTAGS_TEST' ) ) { + return; + } + $this->assertEquals( Runtime::runSource( '$foo=new PhpTagsTest(); $bar=5; $foo = $bar !== $foo; echo $foo,$bar;', array('test'), 77777 ), array( @@ -3869,6 +3925,10 @@ ); } public function testRun_object_operation_test_15() { + if ( !defined( 'PHPTAGS_TEST' ) ) { + return; + } + $this->assertEquals( Runtime::runSource( '$foo=new PhpTagsTest(); $bar=8; $foo = $bar | $foo; echo $foo,$bar;', array('test'), 77777 ), array( @@ -3879,6 +3939,10 @@ ); } public function testRun_object_operation_test_16() { + if ( !defined( 'PHPTAGS_TEST' ) ) { + return; + } + $this->assertEquals( Runtime::runSource( '$foo=new PhpTagsTest(); $bar=8; $foo |= $bar; echo $foo,$bar;', array('test'), 77777 ), array( @@ -3889,6 +3953,10 @@ ); } public function testRun_object_operation_test_17() { + if ( !defined( 'PHPTAGS_TEST' ) ) { + return; + } + $this->assertEquals( Runtime::runSource( '$foo=new PhpTagsTest(); $bar=8; $foo = $bar >> $foo; echo $foo,$bar;', array('test'), 77777 ), array( @@ -3899,6 +3967,10 @@ ); } public function testRun_object_operation_test_18() { + if ( !defined( 'PHPTAGS_TEST' ) ) { + return; + } + $this->assertEquals( Runtime::runSource( '$foo=new PhpTagsTest(); $bar=8; $foo <<= $bar; echo $foo,$bar;', array('test'), 77777 ), array( @@ -3909,6 +3981,10 @@ ); } public function testRun_object_operation_test_19() { + if ( !defined( 'PHPTAGS_TEST' ) ) { + return; + } + $this->assertEquals( Runtime::runSource( '$foo=new PhpTagsTest(); $bar=8; $foo = $bar && $foo; echo $foo,$bar;', array('test'), 77777 ), array( @@ -3918,18 +3994,30 @@ ); } public function testRun_object_operation_test_20() { + if ( !defined( 'PHPTAGS_TEST' ) ) { + return; + } + $this->assertEquals( Runtime::runSource( '$foo=new PhpTagsTest(); $bar= ~$foo; echo $foo,$bar;', array('test'), 77777 ), array( (string) new PhpTagsException( PhpTagsException::FATAL_UNSUPPORTED_OPERAND_TYPES, null, 1, 'test' ) ) ); } public function testRun_object_operation_test_21() { + if ( !defined( 'PHPTAGS_TEST' ) ) { + return; + } + $this->assertEquals( Runtime::runSource( '$foo=new PhpTagsTest(); $bar= !$foo; echo $bar === false;', array('test'), 77777 ), array( true ) ); } public function testRun_object_operation_test_22() { + if ( !defined( 'PHPTAGS_TEST' ) ) { + return; + } + $this->assertEquals( Runtime::runSource( '$foo=new PhpTagsTest(); $bar=(int)$foo; echo $bar;', array('test'), 77777 ), array( @@ -3939,6 +4027,10 @@ ); } public function testRun_object_operation_test_23() { + if ( !defined( 'PHPTAGS_TEST' ) ) { + return; + } + $this->assertEquals( Runtime::runSource( '$foo=new PhpTagsTest(); $bar=(double)$foo; echo $bar;', array('test'), 77777 ), array( @@ -3948,6 +4040,10 @@ ); } public function testRun_object_operation_test_24() { + if ( !defined( 'PHPTAGS_TEST' ) ) { + return; + } + $this->assertEquals( Runtime::runSource( '$foo=new PhpTagsTest(); $bar=(string)$foo; echo $bar;', array('test'), 77777 ), array( @@ -3956,18 +4052,30 @@ ); } public function testRun_object_operation_test_25() { + if ( !defined( 'PHPTAGS_TEST' ) ) { + return; + } + $this->assertEquals( Runtime::runSource( '$foo=new PhpTagsTest(); $bar=(array)$foo; echo $bar[0];', array('test'), 77777 ), array( '(object <PhpTagsTest>)' ) ); } public function testRun_object_operation_test_26() { + if ( !defined( 'PHPTAGS_TEST' ) ) { + return; + } + $this->assertEquals( Runtime::runSource( '$foo=new PhpTagsTest(); $bar=(bool)$foo; echo $bar === true;', array('test'), 77777 ), array( true ) ); } public function testRun_object_operation_test_27() { + if ( !defined( 'PHPTAGS_TEST' ) ) { + return; + } + $this->assertEquals( Runtime::runSource( '$foo=new PhpTagsTest(); $bar=(unset)$foo; echo $bar === null;', array('test'), 77777 ), array( true ) @@ -3975,6 +4083,10 @@ } public function testRun_object_increase_test_1() { + if ( !defined( 'PHPTAGS_TEST' ) ) { + return; + } + $this->assertEquals( Runtime::runSource( '$foo=new PhpTagsTest(); $foo++; echo $foo;', array('test'), 77777 ), array( @@ -3983,6 +4095,10 @@ ); } public function testRun_object_increase_test_2() { + if ( !defined( 'PHPTAGS_TEST' ) ) { + return; + } + $this->assertEquals( Runtime::runSource( '$foo=new PhpTagsTest(); ++$foo; echo $foo;', array('test'), 77777 ), array( @@ -3991,6 +4107,10 @@ ); } public function testRun_object_increase_test_3() { + if ( !defined( 'PHPTAGS_TEST' ) ) { + return; + } + $this->assertEquals( Runtime::runSource( '$foo=new PhpTagsTest(); --$foo; echo $foo;', array('test'), 77777 ), array( @@ -3999,6 +4119,10 @@ ); } public function testRun_object_increase_test_4() { + if ( !defined( 'PHPTAGS_TEST' ) ) { + return; + } + $this->assertEquals( Runtime::runSource( '$foo=new PhpTagsTest(); $foo--; echo $foo;', array('test'), 77777 ), array( @@ -4017,6 +4141,10 @@ ); } public function testRun_object_quote_test_1() { + if ( !defined( 'PHPTAGS_TEST' ) ) { + return; + } + $this->assertEquals( Runtime::runSource( '$foo=new PhpTagsTest(); echo "$foo";', array('test'), 77777 ), array( @@ -4024,6 +4152,5 @@ ) ); } - } -- To view, visit https://gerrit.wikimedia.org/r/304438 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I18b5d0ebaef21d9d6f86d9c124e44e513411ee59 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/PhpTags Gerrit-Branch: REL1_27 Gerrit-Owner: Pastakhov <pastak...@yandex.ru> Gerrit-Reviewer: Pastakhov <pastak...@yandex.ru> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits