| @@ 9-43 (lines=35) @@ | ||
| 6 | use Aura\Sql\ExtendedPdo; |
|
| 7 | use PHPUnit_Framework_TestCase; |
|
| 8 | ||
| 9 | class MysqlActivityRepositoryTest extends PHPUnit_Framework_TestCase |
|
| 10 | { |
|
| 11 | ||
| 12 | public function testIsInstanceOfActivityRepository() |
|
| 13 | { |
|
| 14 | $repository = new MysqlActivityRepository(new ConnectionLocator()); |
|
| 15 | ||
| 16 | $this->assertInstanceOf( |
|
| 17 | 'Jacobemerick\Web\Domain\Stream\Activity\MysqlActivityRepository', |
|
| 18 | $repository |
|
| 19 | ); |
|
| 20 | } |
|
| 21 | ||
| 22 | public function testImplementsActivityInterface() |
|
| 23 | { |
|
| 24 | $repository = new MysqlActivityRepository(new ConnectionLocator()); |
|
| 25 | ||
| 26 | $this->assertInstanceOf( |
|
| 27 | 'Jacobemerick\Web\Domain\Stream\Activity\ActivityRepositoryInterface', |
|
| 28 | $repository |
|
| 29 | ); |
|
| 30 | } |
|
| 31 | ||
| 32 | public function testConstructSetsConnections() |
|
| 33 | { |
|
| 34 | $connection = new ConnectionLocator(); |
|
| 35 | $respository = new MysqlActivityRepository($connection); |
|
| 36 | ||
| 37 | $this->assertAttributeSame( |
|
| 38 | $connection, |
|
| 39 | 'connections', |
|
| 40 | $respository |
|
| 41 | ); |
|
| 42 | } |
|
| 43 | } |
|
| 44 | ||
| @@ 9-43 (lines=35) @@ | ||
| 6 | use Aura\Sql\ExtendedPdo; |
|
| 7 | use PHPUnit_Framework_TestCase; |
|
| 8 | ||
| 9 | class MysqlChangelogRepositoryTest extends PHPUnit_Framework_TestCase |
|
| 10 | { |
|
| 11 | ||
| 12 | public function testIsInstanceOfChangelogRepository() |
|
| 13 | { |
|
| 14 | $repository = new MysqlChangelogRepository(new ConnectionLocator()); |
|
| 15 | ||
| 16 | $this->assertInstanceOf( |
|
| 17 | 'Jacobemerick\Web\Domain\Stream\Changelog\MysqlChangelogRepository', |
|
| 18 | $repository |
|
| 19 | ); |
|
| 20 | } |
|
| 21 | ||
| 22 | public function testImplementsChangelogInterface() |
|
| 23 | { |
|
| 24 | $repository = new MysqlChangelogRepository(new ConnectionLocator()); |
|
| 25 | ||
| 26 | $this->assertInstanceOf( |
|
| 27 | 'Jacobemerick\Web\Domain\Stream\Changelog\ChangelogRepositoryInterface', |
|
| 28 | $repository |
|
| 29 | ); |
|
| 30 | } |
|
| 31 | ||
| 32 | public function testConstructSetsConnections() |
|
| 33 | { |
|
| 34 | $connection = new ConnectionLocator(); |
|
| 35 | $respository = new MysqlChangelogRepository($connection); |
|
| 36 | ||
| 37 | $this->assertAttributeSame( |
|
| 38 | $connection, |
|
| 39 | 'connections', |
|
| 40 | $respository |
|
| 41 | ); |
|
| 42 | } |
|
| 43 | } |
|
| 44 | ||