The following script both demonstrates and documents (in the header comment) the issue, namely that I am unable to detect any difference between the "expected" and "actual" strings:
<?php
/*
$ phpunit MyTest.php
PHPUnit 3.4.0 by Sebastian Bergmann.
F
Time: 0 seconds
There was 1 failure:
1) MyTest::test_print_r
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-O:7:"MyClass":2:{s:13:"MyClassvar3";N;s:4:"var1";N;}
+O:7:"MyClass":2:{s:13:"MyClassvar3";N;s:4:"var1";N;}
.../MyTest.php:41
.../bin/phpunit:54
FAILURES!
Tests: 1, Assertions: 1, Failures: 1.
*/
class MyClass {
static protected $var2;
private $var3;
public $var1;
public function foo($item) {
echo $item . "\n";
}
}
class MyTest extends PHPUnit_Framework_TestCase {
function test_print_r() {
$m = new MyClass();
$this->assertEquals(trim('O:7:"MyClass":2:{s:13:"MyClassvar3";N;s:4:"var1";N;}'), trim(serialize($m)));
}
}
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)