<?php
use PHPUnit\Framework\TestCase;
class MockmapTest extends TestCase
{
public function testMethodMap() : void
{
$mock = Mockery::mock(Fooable::CLASS);
$mock->shouldReceive([
'foo' => 1,
'bar' => 2,
'baz' => new ArrayObject(),
])->once();
$this->assertSame(1, $mock->foo(null));
$this->assertSame(2, $mock->bar());
$this->assertInstanceOf('ArrayObject', $mock->baz());
}
protected function tearDown() : void
{
Mockery::close();
}
}
interface Fooable
{
public function foo($foo);
public function bar();
public function baz();
}