From 509b63837da3c6a43175a29aff4d639fa75e4645 Mon Sep 17 00:00:00 2001 From: efalcy <efalcy@git-test.afi-sa.fr> Date: Fri, 10 Jan 2014 17:27:17 +0000 Subject: [PATCH] Correction tests --- tests/library/Class/AlbumRessourceTest.php | 41 ++++------------------ 1 file changed, 6 insertions(+), 35 deletions(-) diff --git a/tests/library/Class/AlbumRessourceTest.php b/tests/library/Class/AlbumRessourceTest.php index 2b4b6348da6..53a7cd7b1c8 100644 --- a/tests/library/Class/AlbumRessourceTest.php +++ b/tests/library/Class/AlbumRessourceTest.php @@ -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)); } + } -- GitLab