Fix travis tests

This commit is contained in:
Xavier Rousset
2017-12-13 19:14:47 +01:00
parent 1683191d19
commit 3a6f2eb365
3 changed files with 12 additions and 4 deletions

View File

@@ -296,13 +296,21 @@ class databox_subdef
/** /**
* boolean * boolean
* *
* @return type * @return bool
*/ */
public function is_downloadable() public function isDownloadable()
{ {
return $this->downloadable; return $this->downloadable;
} }
/**
* @return bool
*/
public function isOrderable()
{
return $this->orderable;
}
/** /**
* Get an array of Alchemy\Phrasea\Media\Subdef\Subdef available for the current Media Type * Get an array of Alchemy\Phrasea\Media\Subdef\Subdef available for the current Media Type
* *

View File

@@ -401,7 +401,7 @@
<tbody> <tbody>
<tr> <tr>
<td style="width:100px;line-height: 0.9rem;">{{ 'Telechargeable' | trans }}</td> <td style="width:100px;line-height: 0.9rem;">{{ 'Telechargeable' | trans }}</td>
<td style="width:300px;"><input type="checkbox" name="{{subdefgroup}}_{{subdefname}}_downloadable" {% if subdef.is_downloadable() %}checked="checked"{% endif %} value="1" /></td> <td style="width:300px;"><input type="checkbox" name="{{subdefgroup}}_{{subdefname}}_downloadable" {% if subdef.isDownloadable() %}checked="checked"{% endif %} value="1" /></td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>

View File

@@ -83,7 +83,7 @@ class SubdefsTest extends \PhraseanetAuthenticatedWebTestCase
$subdefs = new \databox_subdefsStructure($app->findDataboxById($this->databox_id), $app['translator']); $subdefs = new \databox_subdefsStructure($app->findDataboxById($this->databox_id), $app['translator']);
$subdef = $subdefs->get_subdef("image", $name); $subdef = $subdefs->get_subdef("image", $name);
/* @var $subdef \databox_subdef */ /* @var $subdef \databox_subdef */
$this->assertFalse($subdef->is_downloadable()); $this->assertFalse($subdef->isDownloadable());
$options = $subdef->getOptions(); $options = $subdef->getOptions();
$this->assertTrue(is_array($options)); $this->assertTrue(is_array($options));
$this->assertEquals(400, $options[Image::OPTION_SIZE]->getValue()); $this->assertEquals(400, $options[Image::OPTION_SIZE]->getValue());