Skip to content
Snippets Groups Projects
Commit 509b6383 authored by efalcy's avatar efalcy
Browse files

Correction tests

parent 63f6d99f
Branches
Tags
No related merge requests found
......@@ -176,50 +176,21 @@ class AlbumRessourceReceivingFileTest extends AlbumRessourceFileUploadTestCase {
class AlbumRessourceLoaderTest extends ModelTestCase {
/** @var Zend_Db_Table_Select */
protected $_select;
/** @var PHPUnit_Framework_MockObject_MockObject */
protected $_table;
protected function setUp() {
parent::setUp();
$this->_select = new Zend_Db_Table_Select(
new Storm_Model_Table(array('name' => 'album_ressources'))
);
$this->_table = $this->_buildTableMock(
'Class_AlbumRessource',
array('select', 'info', 'fetchRow')
);
$this->_table->expects($this->any())
->method('select')
->will($this->returnValue($this->_select));
$orderResult = new stdClass();
$orderResult->order = 7;
$this->_table->expects($this->any())
->method('fetchRow')
->will($this->returnValue($orderResult));
$this->_table->expects($this->any())
->method('info')
->with('name')
->will($this->returnValue('album_ressources'));
$this->fixture('Class_AlbumRessource', ['id'=> 998,
'id_album' => 999,
'ordre' => 6]);
}
/** @test */
public function withHarlockGetNextOrderShouldFilterOnHarlock() {
Class_AlbumRessource::getLoader()->getNextOrderFor(
Class_Album::getLoader()->newInstanceWithId(999));
$this->assertRegExp('/\\(id_album = 999\\)/', $this->_select->assemble());
$album=$this->fixture('Class_Album', ['id' => 999]);
$this->assertEquals(7,Class_AlbumRessource::getLoader()->getNextOrderFor($album));
}
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment