Skip to content
Snippets Groups Projects
Commit ce97d0f2 authored by llaffont's avatar llaffont
Browse files

Editeur CSS: sauvegarde du profil à l'upload du CSS

parent 8f694c44
Branches
Tags
No related merge requests found
......@@ -119,7 +119,9 @@ class Admin_ProfilController extends Zend_Controller_Action {
public function uploadCssAction() {
$this->_profil->writeHeaderCss($this->_request->getRawBody());
$this->_profil
->writeHeaderCss($this->_request->getRawBody())
->save();
$this->getHelper('ViewRenderer')->setNoRender();
}
......
......@@ -1290,5 +1290,6 @@ class Class_Profil extends Storm_Model_Abstract {
$this->getFileWriter()->putContents($header_css_path, $data);
return $this;
}
}
\ No newline at end of file
......@@ -33,6 +33,11 @@ class ProfilControllerCssUploadTest extends Admin_AbstractControllerTestCase {
$this->_file_writer = Storm_Test_ObjectWrapper::mock();
Class_Profil::setFileWriter($this->_file_writer);
Storm_Test_ObjectWrapper::onLoaderOfModel('Class_Profil')
->whenCalled('save')
->answers(true);
}
......@@ -71,6 +76,16 @@ class ProfilControllerCssUploadTest extends Admin_AbstractControllerTestCase {
$this->dispatch('/admin/profil/upload-css/id_profil/5', true);
$this->assertTrue($this->_file_writer->methodHasBeenCalled('putContents'));
return Class_Profil::getLoader();
}
/**
* @depends uploadShoulPutContentInANewCssFileWhenProfilHasNoCss
* @test
*/
public function profilShouldBeSaved($profil_loader) {
$this->assertTrue($profil_loader->methodHasBeenCalled('save'));
}
}
......
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