Skip to content

ISSUE-28: testReciprocatesHugs() issue #28

@deezone

Description

@deezone

The test:

   public function testReciprocatesHugs()
    {
        $lostSoul = new LostSoul();

        // PHPUnit 4.5 and Prophecy
        // https://thephp.cc/news/2015/02/phpunit-4-5-and-prophecy
        $mock = $this->prophesize(Huggers::class);

        // Confirm the two LostSoul objects exchange hugs
        $mock->hug($lostSoul)->shouldBeCalled();

        // reveal the prophecy and create an actual test double object
        $lostSoul->hug($mock->reveal());
    }

fails with:

1) Psr\Hug\LostSoulTest::testReciprocatesHugs
Some predictions failed:
  Double\Psr\Hug\Huggers\P1:
    No calls have been made that match:
      Double\Psr\Hug\Huggers\P1->hug(exact(Psr\Hug\LostSoul:000000007e6a573d000000002b15aa86 Object (
        'warmAndFuzzy' => 101
        'hugged' => 20
    )))
    but expected at least one.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions