Commit 027efb7b authored by Ghislain Loas's avatar Ghislain Loas

dev #75742 fix failures and warnings

parent 7d5a0242
......@@ -128,7 +128,7 @@ class ZendAfi_Controller_Action_Helper_AlbumListViewMode extends ZendAfi_Control
}
public function getItemsCols() {
public function getItemsCols($view) {
return [$this->_('Liste des albums')];
}
......
......@@ -21,7 +21,7 @@
class CvsActivatedTestCase extends AbstractControllerTestCase {
abstract class CvsActivatedTestCase extends AbstractControllerTestCase {
protected
$_storm_default_to_volatile = true,
$_user;
......
......@@ -1652,7 +1652,7 @@ class Admin_AlbumControllerEditAlbumMesBDAsPopupTest extends Admin_AlbumControll
/**
* @dataProvider getDispatchUrlAndParams
* @dataProvider getDispatchUrlPopupAndParams
* @test
**/
public function formActionShouldContainsUrlParams($url, $params) {
......
......@@ -31,35 +31,47 @@ class ZendAfi_View_Helper_TagBanniereCycleTest extends ViewHelperTestCase {
defineConstant("PATH_SKIN","");
$content = new Class_Entity(['Files' => ['ban1.jpg',
'ban2.jpg']]);
$this->file_system=$this->createMock('Class_Testing_FileSystem',['readdir',
'opendir',
'file_exists',
'mkdir',
'closedir'
]);
$this->file_system->expects($this->at(2))->method('readdir')->will($this->returnValue('ban1.jpg'));
$this->file_system->expects($this->at(3))->method('readdir')->will($this->returnValue('ban2.jpg'));
$this->file_system->expects($this->any())->method('readdir')->will($this->returnValue(false));
$this->file_system->expects($this->any())->method('opendir')->will($this->returnValue('afile.jpg'));
$this->file_system->expects($this->any())->method('file_exists')->will($this->returnValue(true));
$this->file_system->expects($this->any())->method('mkdir')->will($this->returnValue(false));
$this->file_system->expects($this->any())->method('closedir')->will($this->returnValue(null));
Class_Profil::setFileSystem($this->file_system);
$this->profil = $this->fixture('Class_Profil',
['id' => 999, 'header_img_cycle' => true]);
$this->file_system = $this->mock()
$this->_helper = new ZendAfi_View_Helper_TagBanniere();
$this->_helper->setView(new ZendAfi_Controller_Action_Helper_View());
$this->_helper->view->profil = Class_Profil::getLoader()
->newInstanceWithId(4)
->setHeaderImgCycle(true);
->whenCalled('file_exists')
->with('./userfiles/bannieres')
->answers('true')
->whenCalled('opendir')
->with('./userfiles/bannieres')
->answers($content)
->whenCalled('readdir')
->with($content)
->willDo(function() use ($content)
{
$files = $content->getFiles();
$read = array_shift($files);
$content->setFiles($files);
return $read ? $read : false;
})
->whenCalled('closedir')
->with($content)
->answers(true)
->beStrict();
Class_Profil::setFileSystem($this->file_system);
$this->view->profil = $this->fixture('Class_Profil',
['id' => 999,
'header_img_cycle' => true]);
$this->_helper = new ZendAfi_View_Helper_TagBanniere();
$this->_helper->setView($this->view);
$this->_html = $this->_helper->tagBanniere();
}
/** @test */
function divBanniereShouldBePresent() {
$this->assertXPath($this->_html, '//div[@id="banniere"]');
......
Markdown is supported
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