Skip to content

Commit

Permalink
ObservableModel creation test
Browse files Browse the repository at this point in the history
  • Loading branch information
leodido committed Sep 12, 2014
1 parent 6782334 commit 9937b5f
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/MatryoshkaTest/Model/AbstractModelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

use Matryoshka\Model\Criteria\CallableCriteria;
use Matryoshka\Model\Model;
use Matryoshka\Model\ObservableModel;
use MatryoshkaTest\Model\Mock\Criteria\MockCriteria;
use Matryoshka\Model\ResultSet\ArrayObjectResultSet as ResultSet;
use MatryoshkaTest\Model\TestAsset\ConcreteAbstractModel;
Expand All @@ -29,6 +30,11 @@ class AbstractModelTest extends \PHPUnit_Framework_TestCase
*/
protected $model;

/**
* @var \Matryoshka\Model\ObservableModel
*/
protected $obsModel; // TODO: test ObservableModel

protected $mockDataGateway;

protected $mockCriteria;
Expand All @@ -42,6 +48,8 @@ public function setUp()
$this->resultSet = new ResultSet();

$this->model = new Model($this->mockDataGateway, $this->resultSet);

$this->obsModel = new ObservableModel($this->mockDataGateway, $this->resultSet);
}

public function testWithoutConstructor()
Expand Down Expand Up @@ -142,6 +150,15 @@ public function testCreate()
$this->assertNotSame($prototype, $newObj);
}

public function testCreateObservable()
{
$prototype = $this->obsModel->getObjectPrototype();
$newObj = $this->obsModel->create();

$this->assertEquals($prototype, $newObj);
$this->assertNotSame($prototype, $newObj);
}

public function testFindAbstractCriteria()
{
$criteria = new MockCriteria();
Expand Down

0 comments on commit 9937b5f

Please sign in to comment.