Skip to content

Commit

Permalink
Merge 4425b91 into ef988fb
Browse files Browse the repository at this point in the history
  • Loading branch information
mjacobus committed Oct 4, 2016
2 parents ef988fb + 4425b91 commit e0053c7
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
10 changes: 5 additions & 5 deletions src/RepositoryAbstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,22 @@ abstract class RepositoryAbstract implements RepositoryInterface
/**
* @var StorageInterface
*/
private $persistence;
private $storage;

/**
* @param StorageInterface $persistence
* @param StorageInterface $storage
*/
public function __construct(StorageInterface $persistence)
public function __construct(StorageInterface $storage)
{
$this->persistence = $persistence;
$this->storage = $storage;
}

/**
* @return MySql
*/
protected function getStorage()
{
return $this->persistence;
return $this->storage;
}

/**
Expand Down
12 changes: 6 additions & 6 deletions tests/IdAwareRepositoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ class IdAwareRepositoryTest extends DbTestCase
/** @var TestTable */
protected $entityPrototype;
/** @var MySql */
protected $persitence;
protected $storage;

public function setUp()
{
parent::setUp();
$this->persitence = $this->getMock('Koine\Repository\Storage\StorageInterface');
$this->repository = new IdAwareRepository($this->persitence);
$this->storage = $this->getMock('Koine\Repository\Storage\StorageInterface');
$this->repository = new IdAwareRepository($this->storage);
$this->hydrator = new ClassMethods();
$this->entityPrototype = new TestTableEntity();

Expand All @@ -41,7 +41,7 @@ public function canInsertAnEntity()
'value' => 'bar',
);

$this->persitence
$this->storage
->expects($this->once())
->method('insert')
->with($params)
Expand All @@ -65,7 +65,7 @@ public function canUpdateAnEntity()
'value' => 'bar',
);

$this->persitence
$this->storage
->expects($this->once())
->method('updateWhere')
->with($expectedConditions, $expectedParams)
Expand All @@ -83,7 +83,7 @@ public function canRemoveEntity()
{
$expectedConditions = array('id' => 1);

$this->persitence
$this->storage
->expects($this->once())
->method('deleteWhere')
->with($expectedConditions)
Expand Down
14 changes: 7 additions & 7 deletions tests/RepositoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ class RepositoryTest extends DbTestCase
/** @var TestTable */
protected $entityPrototype;
/** @var MySql */
protected $persitence;
protected $storage;

public function setUp()
{
parent::setUp();
$this->persitence = $this->getMock('Koine\Repository\Storage\StorageInterface');
$this->repository = new Repository($this->persitence);
$this->storage = $this->getMock('Koine\Repository\Storage\StorageInterface');
$this->repository = new Repository($this->storage);
$this->hydrator = new ClassMethods();
$this->entityPrototype = new TestTableEntity();

Expand Down Expand Up @@ -54,7 +54,7 @@ public function canGetHydrator()
*/
public function getHydratorThrowsExceptionWhenHydratorIsNotSet()
{
$repository = new Repository($this->persitence);
$repository = new Repository($this->storage);
$repository->getHydrator();
}

Expand All @@ -74,7 +74,7 @@ public function canGetEntityPrototype()
*/
public function getEntityPrototypeThrowsExceptionWhenEntityPrototypeIsNotSet()
{
$repository = new Repository($this->persitence);
$repository = new Repository($this->storage);
$repository->getEntityPrototype();
}

Expand All @@ -90,7 +90,7 @@ public function findOneByReturnsAHydratorEntity()
'value' => 'bar',
);

$this->persitence
$this->storage
->expects($this->once())
->method('findOneBy')
->with($params)
Expand Down Expand Up @@ -119,7 +119,7 @@ public function findAllByReturnsCollection()
),
);

$this->persitence
$this->storage
->expects($this->once())
->method('findAllBy')
->with($params)
Expand Down

0 comments on commit e0053c7

Please sign in to comment.