Working with a laravel 5 app and have a problem with phpspec. Why does my Phpspec unit test below fail or more precisely how can I get the stdClass Object keys to match so that it wouldn't fail?
My spec file:
function it_checks_add_starting_date_to_flow()
{
$dealflows = new \stdClass ();
this->add_starting_date_to_flow($dealflows)->shouldReturn((object)[]);
}
And my helper function that I am testing:
public static function add_starting_date_to_flow($dealflows)
{
$dealflows= new \stdClass();
return $dealflows;
}
From phpspec I get the following response:
App/libraries/Mmdealhelpers
65 - it checks add starting date to flow
expected [obj:stdClass], but got [obj:stdClass].
@@ -1,1 +1,1 @@
-stdClass Object &000000001d025295000000007dd68060 ()
+stdClass Object &000000001d02529a000000007dd68060 ()
80 // ]
81 // ));
82 $this->add_starting_date_to_flow($dealflows)->shouldReturn((object)[]);
83
84 }
85
0 vendor/phpspec/phpspec/src/PhpSpec/Matcher/IdentityMatcher.php:78
throw new PhpSpec\Exception\Example\NotEqualException("Expected [obj:stdC...")
1 [internal]
spec\App\libraries\MmdealhelpersSpec->it_checks_add_starting_date_to_flow()