Skip to content
Snippets Groups Projects
Commit 762abaf2 authored by Laurent's avatar Laurent
Browse files

Parser fix

parent c8d91ba6
Branches
Tags
4 merge requests!780Master,!722Master,!717Master,!714Rd #14085 pnb
......@@ -16,7 +16,7 @@
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class Class_WebService_BibNumerique_ArteVOD_Film extends Class_WebService_BibNumerique_RessourceNumerique {
......@@ -26,7 +26,6 @@ class Class_WebService_BibNumerique_ArteVOD_Film extends Class_WebService_BibNu
protected $_title;
protected $_description;
protected $_year;
protected $_authors = [];
protected $_posters = [];
protected $_trailers = [];
protected $_photos = [];
......@@ -52,7 +51,7 @@ class Class_WebService_BibNumerique_ArteVOD_Film extends Class_WebService_BibNu
$this->duration = $duration;
}
public function getDuration() {
return $this->duration;
}
......@@ -64,7 +63,7 @@ class Class_WebService_BibNumerique_ArteVOD_Film extends Class_WebService_BibNu
public function getTags() {
return implode($this->_tags,';');
}
public function addActor($actor) {
$this->_actors[] = $actor;
return $this;
......
......@@ -42,7 +42,7 @@ class Class_WebService_BibNumerique_RessourceNumerique {
protected $_ressources = [];
protected $_zones = [];
protected $_bibliotheques='';
protected $_authors = [];
public function setId($id) {
$this->_id = $id;
......
......@@ -152,11 +152,16 @@ class Class_WebService_XMLParser {
protected function _callFuncOrClosure($method_name, $data) {
$callable = property_exists($this->_element_handler, $method_name)
? $this->_element_handler->$method_name
: [$this->_element_handler, $method_name];
$callable = null;
call_user_func($callable, $data);
if (property_exists($this->_element_handler, $method_name))
$callable = $this->_element_handler->$method_name;
if (method_exists($this->_element_handler, $method_name))
$callable = [$this->_element_handler, $method_name];
if ($callable)
call_user_func($callable, $data);
}
......
......@@ -30,6 +30,11 @@ class DilicomONIXParserTest extends Storm_Test_ModelTestCase {
$this->_book = Class_WebService_BibNumerique_Dilicom_ONIXFile::bookFromXML($xml);
}
public function tearDown() {
Storm_Model_Loader::defaultToDb();
parent::tearDown();
}
/** @test */
public function bookShouldNotBeNull() {
......
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