public function test_getTransactionMinDateApplied() { /** === Test Data === */ $ASSET_TYPE_ID = '12'; $DATE_FOUND = '20150810'; $TBL_ACC = 'account table'; $TBL_TRANS = 'transaction table'; /** === Setup Mocks === */ // $tblAccount = $this->_resource->getTableName(Account::ENTITY_NAME); $this->mResource->shouldReceive('getTableName')->with(\Praxigento\Accounting\Data\Entity\Account::ENTITY_NAME)->andReturn($TBL_ACC); // $tblTrans = $this->_resource->getTableName(Transaction::ENTITY_NAME); $this->mResource->shouldReceive('getTableName')->with(\Praxigento\Accounting\Data\Entity\Transaction::ENTITY_NAME)->andReturn($TBL_TRANS); // $query = $this->_conn->select(); $mQuery = $this->_mockDbSelect(); $this->mConn->shouldReceive('select')->andReturn($mQuery); $mQuery->shouldReceive('from'); $mQuery->shouldReceive('joinLeft'); $mQuery->shouldReceive('where'); $mQuery->shouldReceive('order'); // $row = $this->_conn->fetchOne($query, $bind); $this->mConn->shouldReceive('fetchOne')->andReturn($DATE_FOUND); /** === Call and asserts === */ $resp = $this->repo->getTransactionMinDateApplied($ASSET_TYPE_ID); $this->assertEquals($DATE_FOUND, $resp); }
public function test_getTransactionMinDateApplied() { $data = $this->_obj->getTransactionMinDateApplied(6); $this->assertTrue($data > 0); }