diff options
author | valmat <ufabiz@gmail.com> | 2014-03-28 00:42:09 +0600 |
---|---|---|
committer | valmat <ufabiz@gmail.com> | 2014-03-28 00:42:09 +0600 |
commit | 28152192b85cbe9bf5ea08ebe8c706d12e2e13e5 (patch) | |
tree | d8a5cbee7e39f6b21c0e698d1ac10ac764b00193 /tests/php/phpt | |
parent | f56cff9e4f67a949e6f0ae35ca63aaaea16d9a41 (diff) |
add test: class_obj/003-comparable.phpt
Diffstat (limited to 'tests/php/phpt')
-rw-r--r-- | tests/php/phpt/class_obj/001.phpt (renamed from tests/php/phpt/base/001.phpt) | 0 | ||||
-rw-r--r-- | tests/php/phpt/class_obj/002.phpt (renamed from tests/php/phpt/base/002.phpt) | 0 | ||||
-rw-r--r-- | tests/php/phpt/class_obj/003-comparable.phpt | 46 | ||||
-rw-r--r-- | tests/php/phpt/class_obj/readme (renamed from tests/php/phpt/base/readme) | 0 |
4 files changed, 46 insertions, 0 deletions
diff --git a/tests/php/phpt/base/001.phpt b/tests/php/phpt/class_obj/001.phpt index b22a44c..b22a44c 100644 --- a/tests/php/phpt/base/001.phpt +++ b/tests/php/phpt/class_obj/001.phpt diff --git a/tests/php/phpt/base/002.phpt b/tests/php/phpt/class_obj/002.phpt index 847e602..847e602 100644 --- a/tests/php/phpt/base/002.phpt +++ b/tests/php/phpt/class_obj/002.phpt diff --git a/tests/php/phpt/class_obj/003-comparable.phpt b/tests/php/phpt/class_obj/003-comparable.phpt new file mode 100644 index 0000000..8ffc076 --- /dev/null +++ b/tests/php/phpt/class_obj/003-comparable.phpt @@ -0,0 +1,46 @@ +--TEST-- +Test constructor & destructor +--SKIPIF-- +<?php if (!extension_loaded("extension_for_tests")) print "skip"; ?> +--FILEEOF-- +<?php + +// 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"); +} + + +//echo PHP_EOL; +--EXPECT-- +Obj#1(2) is bigger than Obj#2(1) +Obj#1(2) is equal to Obj#3(2) +Obj#1(2) is not equal to Obj#2(1)
\ No newline at end of file diff --git a/tests/php/phpt/base/readme b/tests/php/phpt/class_obj/readme index 6c89a94..6c89a94 100644 --- a/tests/php/phpt/base/readme +++ b/tests/php/phpt/class_obj/readme |