dependency-injection-example icon indicating copy to clipboard operation
dependency-injection-example copied to clipboard

Expected vs Actual

Open DavertMik opened this issue 11 years ago • 0 comments

Thanks to the great tutorials! I noticed a mistake in your code

https://github.com/daylerees/dependency-injection-example/blob/master/part-9/tests/SocialFeedTest.php#L41

        $this->assertEquals($v[0], 'foo');
        $this->assertEquals($v[1], 'bar');
        $this->assertEquals($v[2], 'baz');
        $this->assertEquals($v[3], 'boo');
        $this->assertEquals($v[4], 'bop');

In PHPUnit (as well as all xUnit frameworks) the first argument in assertion is expected, and second is actual. So you should flip this code to look like:

        $this->assertEquals('foo', $v[0]);

DavertMik avatar Apr 11 '14 23:04 DavertMik