我通过 CakePHP v2.3 使用 PHPUnit 3.7.10 并运行以下命令:
$this->assertEquals(array('a', 'b', 'c'), array('a', 'c', 'd'));
我得到的只是:
Failed asserting that two arrays are equal.
为什么我没有得到这里概述的差异?http://www.phpunit.de/manual/current/en/writing-tests-for-phpunit.html#writing-tests-for-phpunit.assertions.assertEquals.example5
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
Array (
0 => 'a'
- 1 => 'b'
- 2 => 'c'
+ 1 => 'c'
+ 2 => 'd'
)
我错过了什么?
更新。通过 test.php?case=Cache/Engine/PhpUnit&debug=1 调用的测试文件
<?php
class PhpUnitTest extends CakeTestCase {
public function testDiff() {
$this->assertEquals(array('a', 'b', 'c'), array('a', 'c', 'd'));
}
}