Skip to content

Commit

Permalink
Update Model_Entity and MapperTestCase
Browse files Browse the repository at this point in the history
- Reference ids can be set now via Model_Entity constructor
- MapperTestCase mocks now also insert and update methods of DbTable
  • Loading branch information
kblomqvist committed May 17, 2011
1 parent 70055e1 commit 2626959
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion library/Kblom/Model/Entity.php
Expand Up @@ -55,11 +55,14 @@ class Kblom_Model_Entity
*/
protected $_references = array();

public function __construct($data = null)
public function __construct($data = null, $references = null)
{
if (!is_null($data)) {
$this->setProperties($data);
}
if (!is_null($references)) {
$this->setReferenceIds($references);
}
}

public function setProperties($data)
Expand Down
2 changes: 1 addition & 1 deletion library/Kblom/Test/MapperTestCase.php
Expand Up @@ -69,7 +69,7 @@ public function setUp()
$this->_adapter = $this->getMock('Zend_Db_Adapter_Mysqli',
array(), array(), '', false);
$this->_dbTable = $this->getMock('Zend_Db_Table_Abstract',
array('find', 'fetchAll', 'select'), array(), '', false);
array('find', 'insert', 'update', 'fetchAll', 'select'), array(), '', false);
$this->_select = $this->getMock('Zend_Db_Table_Select',
array(), array(), '', false);
$this->_rowset = $this->getMock('Zend_Db_Table_Rowset_Abstract',
Expand Down

0 comments on commit 2626959

Please sign in to comment.