1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
<?php namespace Psecio\Gatekeeper; class Base extends \PHPUnit_Framework_TestCase { public function buildMock($return, $type = 'find') { $ds = $this->getMockBuilder('\Psecio\Gatekeeper\DataSource\Stub') ->setConstructorArgs(array(array())) ->getMock(); $ds->method($type) ->willReturn($return); return $ds; } }