diff options
author | valmat <ufabiz@gmail.com> | 2014-03-28 02:34:51 +0600 |
---|---|---|
committer | valmat <ufabiz@gmail.com> | 2014-03-28 02:34:51 +0600 |
commit | 7bc500847e3027bb785c5525a21078ff72acc2ab (patch) | |
tree | 06e29578cbaf38e328b662c6e4130ad07b055f39 /tests/php | |
parent | 28152192b85cbe9bf5ea08ebe8c706d12e2e13e5 (diff) |
add test: 004-static-funct.phpt (Test class with static function)
Diffstat (limited to 'tests/php')
-rw-r--r-- | tests/php/dbg.php | 35 | ||||
-rw-r--r-- | tests/php/phpt/class_obj/003-comparable.phpt | 2 | ||||
-rw-r--r-- | tests/php/phpt/class_obj/004-static-funct.phpt | 26 |
3 files changed, 27 insertions, 36 deletions
diff --git a/tests/php/dbg.php b/tests/php/dbg.php index b9841c7..9a28fc6 100644 --- a/tests/php/dbg.php +++ b/tests/php/dbg.php @@ -11,38 +11,3 @@ - -//- - -// initialize a couple of objects -$object1 = new TestBaseClass\Comparable(); -$object2 = new TestBaseClass\Comparable(); -$object3 = new TestBaseClass\Comparable(); - -// compare the objects -if ($object1 < $object2) -{ - echo("$object1 is smaller than $object2\n"); -} -else -{ - echo("$object1 is bigger than $object2\n"); -} - -if ($object1 == $object3) -{ - echo("$object1 is equal to $object3\n"); -} -else -{ - echo("$object1 is not equal to $object3\n"); -} - -if ($object1 != $object2) -{ - echo("$object1 is not equal to $object2\n"); -} -else -{ - echo("$object1 is equal to $object2\n"); -}
\ No newline at end of file diff --git a/tests/php/phpt/class_obj/003-comparable.phpt b/tests/php/phpt/class_obj/003-comparable.phpt index 8ffc076..3e0b1f6 100644 --- a/tests/php/phpt/class_obj/003-comparable.phpt +++ b/tests/php/phpt/class_obj/003-comparable.phpt @@ -1,5 +1,5 @@ --TEST-- -Test constructor & destructor +Test comparable objects --SKIPIF-- <?php if (!extension_loaded("extension_for_tests")) print "skip"; ?> --FILEEOF-- diff --git a/tests/php/phpt/class_obj/004-static-funct.phpt b/tests/php/phpt/class_obj/004-static-funct.phpt new file mode 100644 index 0000000..8c78210 --- /dev/null +++ b/tests/php/phpt/class_obj/004-static-funct.phpt @@ -0,0 +1,26 @@ +--TEST-- +Test class with static function +--SKIPIF-- +<?php if (!extension_loaded("extension_for_tests")) print "skip"; ?> +--FILEEOF-- +<?php + +// this will call PublicClass::staticMethod() +TestBaseClass\ClassWithStatic::static1(); + +// this will call PrivateClass::staticMethod() +TestBaseClass\ClassWithStatic::static2(); + +// this will call regularFunction() +TestBaseClass\ClassWithStatic::static3(); + +// this will also call PrivateClass::staticMethod() +TestBaseClass\staticFun1(); + + +//echo PHP_EOL; +--EXPECT-- +testStaticPubClass::staticMethod() +testStatic regular function +testStaticPrivClass::staticMethod() +testStaticPrivClass::staticMethod()
\ No newline at end of file |