diff options
author | valmat <ufabiz@gmail.com> | 2014-03-27 01:19:12 +0600 |
---|---|---|
committer | valmat <ufabiz@gmail.com> | 2014-03-27 01:19:12 +0600 |
commit | d0d062b4a05a9eb64b8d2e6d038af96ac532e4b3 (patch) | |
tree | 4fc4026b988ca6da18a88d2e34dd1d88c28d24ae /tests/php/phpt/variables/007-overloaded-operators.phpt | |
parent | 702c95cf779226550af6b33255a8e1b28ccca428 (diff) |
Added new tests.
Due to support zts broke the ability to run tests without installation - fixed.
Diffstat (limited to 'tests/php/phpt/variables/007-overloaded-operators.phpt')
-rw-r--r-- | tests/php/phpt/variables/007-overloaded-operators.phpt | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/tests/php/phpt/variables/007-overloaded-operators.phpt b/tests/php/phpt/variables/007-overloaded-operators.phpt new file mode 100644 index 0000000..a26b1a4 --- /dev/null +++ b/tests/php/phpt/variables/007-overloaded-operators.phpt @@ -0,0 +1,51 @@ +--TEST-- +Test Php::Value overloaded operators +--DESCRIPTION-- + +Many different operators are overloaded too so that you can use a Php::Value object directly in arithmetric operations, +compare it with other variables, or send it to an output stream. + + +--SKIPIF-- +<?php if (!extension_loaded("extension_for_tests")) print "skip"; ?> +--FILEEOF-- +<?php + + +TestVariables\overloaded_op(5); +TestVariables\overloaded_op(3.14); +TestVariables\overloaded_op(12); +TestVariables\overloaded_op(120); +TestVariables\overloaded_op(-1000); +TestVariables\overloaded_op("some string"); + + + +--EXPECT-- +15 +7 +1851.75 +0.121507 +13.14 +5 +1622.13 +0.10644 +value == 12 +22 +14 +2715.9 +0.17821 +value > 100 +130 +122 +16048.5 +1.05306 +-990 +-998 +-122216 +-8.01944 +value == 'some string' +10 +2 +1234.5 +0.0810045
\ No newline at end of file |