Last active
July 15, 2016 17:25
-
-
Save chukShirley/71cba1ff64be308ce18857c7184c5cfb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Temp; | |
use ToolkitApi\Toolkit; | |
class Dummy | |
{ | |
/** @var Toolkit */ | |
private $ibmiToolkit; | |
/** | |
* Dummy constructor. | |
* @param Toolkit $ibmiToolkit | |
*/ | |
public function __construct(Toolkit $ibmiToolkit) | |
{ | |
$this->ibmiToolkit = $ibmiToolkit; | |
} | |
public function dummyMethod() | |
{ | |
return $this->ibmiToolkit->AddParameterPackDec('both', 9, 0, 'SRN', 'SRN', 0); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace TempTest; | |
use PHPUnit_Framework_TestCase; | |
use Temp\Dummy; | |
use ToolkitApi\Toolkit; | |
class DummyTest extends PHPUnit_Framework_TestCase | |
{ | |
public function testDummyMethod() | |
{ | |
$ibmiToolkit = $this->getMockBuilder(Toolkit::class) | |
->disableOriginalConstructor() | |
->getMock(); | |
$ibmiToolkit->expects(self::any()) | |
->method('AddParameterPackDec') | |
->withAnyParameters() | |
->willReturn('test'); | |
/** @var Toolkit $ibmiToolkit */ | |
$dummy = new Dummy( | |
$ibmiToolkit | |
); | |
$this->assertEquals('test', $dummy->dummyMethod()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@chukShirley I haven't seen
->withAnyParameters()
before, but instead->with($this->any())