Skip to content
Snippets Groups Projects
Commit b3823214 authored by Patrick Barroca's avatar Patrick Barroca :grin:
Browse files

rel #14409 : fix tests failures

parent 32af275b
Branches
Tags 5.12
2 merge requests!529Hotline 6.56,!407Dev/14409 filters in calendar box
......@@ -56,8 +56,8 @@ class AlbumRessourceInitializationTest extends AlbumRessourceFileUploadTestCase
/** @test */
public function whenHandlerHasErrorShouldReturnErrorArray() {
$handler = $this->mock()
->whenCalled('getError')
->answers('Error message');
->whenCalled('getError')->answers('Error message')
->whenCalled('handleUpload')->answers(false);
$result = $this->_resource->setMultiUploadHandler($handler)
->initializeWith(null);
......@@ -70,8 +70,8 @@ class AlbumRessourceInitializationTest extends AlbumRessourceFileUploadTestCase
/** @test */
public function whenHandlerHasErrorShouldCallDelete() {
$handler = $this->mock()
->whenCalled('getError')
->answers('Error message');
->whenCalled('getError')->answers('Error message')
->whenCalled('handleUpload')->answers(false);
$result = $this->_resource->setMultiUploadHandler($handler)
->initializeWith(null);
......@@ -84,7 +84,8 @@ class AlbumRessourceInitializationTest extends AlbumRessourceFileUploadTestCase
public function whenHandlerHasNoErrorShouldReturnSuccessArray() {
$handler = $this->mock()
->whenCalled('getError')->answers(null)
->whenCalled('handleUpload')->answers(true);
->whenCalled('handleUpload')->answers(true)
->whenCalled('getSavedFileName')->answers('toto.jpg');
$this->assertEquals(['success' => 'true'],
$this->_resource->setMultiUploadHandler($handler)
......@@ -124,7 +125,8 @@ class AlbumRessourceReceivingFileTest extends AlbumRessourceFileUploadTestCase {
public function withUploadErrorShouldReturnFalse() {
$_FILES['fichier']['size'] = 1;
$handler = $this->mock()
->whenCalled('receive')->answers(false);
->whenCalled('receive')->answers(false)
->whenCalled('getError')->answers('');
$handler->whenCalled('resetError')->answers($handler);
$this->assertFalse($this->_resource->setUploadHandlerFor($handler, 'fichier')
......
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