Mock objects with Prophecy in PHPUnit

Code
<?php

use Prophecy\Argument\Token\AnyValueToken;

class 
ProphecyTest extends PHPUnit_Framework_TestCase
{
    public function 
testMockInvocation()
    {
        
$fooProphecy $this->prophesize(Foo::CLASS);
        
// allow every argument for method Foo::bar()
        
$fooProphecy->bar(new AnyValueToken())
            ->
willReturn(true)
            ->
shouldBeCalledTimes(2);
        
        
// reveal the prophecy of Foo
        // this is the mock for your tests to inject
        
$foo $fooProphecy->reveal();
        
        
$this->assertTrue($foo->bar(null));
        
$this->assertTrue($foo->bar(1));
        
// Only 2 invocations of Foo::bar() are expected
        
$this->assertTrue($foo->bar('test'));
    }
}

interface 
Foo
{
    public function 
bar($value);
}
Result
Time: 215 ms, Memory: 2.00MB

There was 1 failure:

1) ProphecyTest::testMockInvocation
Some predictions failed:
Double\Foo\P1:
Expected exactly 2 calls that match:
Double\Foo\P1->bar(*)
but 3 were made:
- bar(null) ProphecyTest.php:19
- bar(1) ProphecyTest.php:20
- bar("test") ProphecyTest.php:22

PhpunitExec.php:21

FAILURES!
Tests: 1, Assertions: 0, Failures: 1.
Used Versions
PHP 7.1, Zend 3.0, Symfony 3.2, Laravel 5.2, PHPUnit 5.6, Doctrine 2.6