| 1 | <?php |
||
| 18 | */ |
||
| 19 | class AbstractAdapterTest extends \PHPUnit_Framework_TestCase |
||
| 20 | { |
||
| 21 | /** |
||
| 22 | * @var AdapterStub |
||
| 23 | */ |
||
| 24 | protected $adapter; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * {@inheritdoc} |
||
| 28 | */ |
||
| 29 | public function setUp() |
||
| 30 | { |
||
| 31 | $this->adapter = new AdapterStub(['param1' => 'value1']); |
||
| 32 | } |
||
| 33 | |||
| 34 | /** |
||
| 35 | * @expectedException \Jgut\Tify\Exception\AdapterException |
||
| 36 | * @expectedExceptionMessage Invalid parameter provided |
||
| 37 | */ |
||
| 38 | public function testUndefinedParameter() |
||
| 39 | { |
||
| 40 | $this->getMockForAbstractClass(AbstractAdapter::class, [['undefined' => null]]); |
||
| 41 | } |
||
| 42 | |||
| 43 | /** |
||
| 44 | * @expectedException \Jgut\Tify\Exception\AdapterException |
||
| 45 | * @expectedExceptionMessageRegExp /^Missing parameters/ |
||
| 46 | */ |
||
| 47 | public function testMissingParameter() |
||
| 48 | { |
||
| 49 | $this->getMockForAbstractClass(AdapterStub::class); |
||
| 50 | } |
||
| 51 | |||
| 52 | public function testDefaults() |
||
| 53 | { |
||
| 54 | self::assertFalse($this->adapter->isSandbox()); |
||
| 55 | } |
||
| 56 | |||
| 57 | public function testAccessorsMutators() |
||
| 58 | { |
||
| 59 | $this->adapter->setSandbox(true); |
||
| 66 |