Update border manager tests

This commit is contained in:
Romain Neutron
2012-09-21 16:36:06 +02:00
parent 49588c24f0
commit 3b6a6516f6
2 changed files with 17 additions and 16 deletions

View File

@@ -48,7 +48,7 @@ class AbstractCheckerTest extends \PhraseanetPHPUnitAbstract
public function getDataboxesCombinaison() public function getDataboxesCombinaison()
{ {
$databox = $collection = null; $databox = $collection = null;
$app = new Application('test'); $app = self::$application;
$appbox = $app['phraseanet.appbox']; $appbox = $app['phraseanet.appbox'];
foreach ($appbox->get_databoxes() as $db) { foreach ($appbox->get_databoxes() as $db) {
@@ -100,7 +100,7 @@ class AbstractCheckerTest extends \PhraseanetPHPUnitAbstract
public function getCollectionsCombinaison() public function getCollectionsCombinaison()
{ {
$othercollection = $collection = null; $othercollection = $collection = null;
$app = new Application('test'); $app = self::$application;
$appbox = $app['phraseanet.appbox']; $appbox = $app['phraseanet.appbox'];
foreach ($appbox->get_databoxes() as $db) { foreach ($appbox->get_databoxes() as $db) {
@@ -171,7 +171,7 @@ class AbstractCheckerTest extends \PhraseanetPHPUnitAbstract
public function getDataboxAndCollection() public function getDataboxAndCollection()
{ {
$databox = $collection = null; $databox = $collection = null;
$app = new Application('test'); $app = self::$application;
$appbox = $app['phraseanet.appbox']; $appbox = $app['phraseanet.appbox'];
foreach ($appbox->get_databoxes() as $db) { foreach ($appbox->get_databoxes() as $db) {

View File

@@ -4,9 +4,9 @@ namespace Alchemy\Phrasea\Border;
use Alchemy\Phrasea\Border\Attribute\AttributeInterface; use Alchemy\Phrasea\Border\Attribute\AttributeInterface;
require_once __DIR__ . '/../../../PhraseanetPHPUnitAuthenticatedAbstract.class.inc'; require_once __DIR__ . '/../../../PhraseanetWebTestCaseAuthenticatedAbstract.class.inc';
class ManagerTest extends \PhraseanetPHPUnitAuthenticatedAbstract class ManagerTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
{ {
/** /**
* @var Manager * @var Manager
@@ -59,6 +59,7 @@ class ManagerTest extends \PhraseanetPHPUnitAuthenticatedAbstract
$this->object = null; $this->object = null;
parent::tearDown(); parent::tearDown();
} }
/** /**
* @covers Alchemy\Phrasea\Border\Manager::process * @covers Alchemy\Phrasea\Border\Manager::process
* @covers Alchemy\Phrasea\Border\Manager::createLazaret * @covers Alchemy\Phrasea\Border\Manager::createLazaret
@@ -142,7 +143,7 @@ class ManagerTest extends \PhraseanetPHPUnitAuthenticatedAbstract
continue; continue;
} }
if ($databox_field->is_on_error() || ! $databox_field->get_tag()->getTagname()) { if ($databox_field->is_on_error() || !$databox_field->get_tag()->getTagname()) {
continue; continue;
} }
@@ -159,7 +160,7 @@ class ManagerTest extends \PhraseanetPHPUnitAuthenticatedAbstract
$data = array('Hello Mono ' . $databox_field->get_tag()->getTagname()); $data = array('Hello Mono ' . $databox_field->get_tag()->getTagname());
if (! $first) { if (!$first) {
if ($odd) { if ($odd) {
$value = new \PHPExiftool\Driver\Value\Mono(current($data)); $value = new \PHPExiftool\Driver\Value\Mono(current($data));
$tofetch [$databox_field->get_name()] = $data; $tofetch [$databox_field->get_name()] = $data;
@@ -180,7 +181,7 @@ class ManagerTest extends \PhraseanetPHPUnitAuthenticatedAbstract
} }
} }
$odd = ! $odd; $odd = !$odd;
} }
$file->addAttribute(new Attribute\Story(self::$records['record_story_1'])); $file->addAttribute(new Attribute\Story(self::$records['record_story_1']));
@@ -208,7 +209,7 @@ class ManagerTest extends \PhraseanetPHPUnitAuthenticatedAbstract
} }
} }
if (! $found) { if (!$found) {
$this->fail('Unable to find story in parents'); $this->fail('Unable to find story in parents');
} }
@@ -230,6 +231,7 @@ class ManagerTest extends \PhraseanetPHPUnitAuthenticatedAbstract
} }
} }
} }
/** /**
* @covers Alchemy\Phrasea\Border\Manager::createLazaret * @covers Alchemy\Phrasea\Border\Manager::createLazaret
*/ */
@@ -249,7 +251,7 @@ class ManagerTest extends \PhraseanetPHPUnitAuthenticatedAbstract
continue; continue;
} }
if ($databox_field->is_on_error() || ! $databox_field->get_tag()->getTagname()) { if ($databox_field->is_on_error() || !$databox_field->get_tag()->getTagname()) {
continue; continue;
} }
@@ -277,7 +279,7 @@ class ManagerTest extends \PhraseanetPHPUnitAuthenticatedAbstract
} }
} }
$odd = ! $odd; $odd = !$odd;
} }
$file->addAttribute(new Attribute\Story(self::$records['record_story_1'])); $file->addAttribute(new Attribute\Story(self::$records['record_story_1']));
@@ -307,7 +309,7 @@ class ManagerTest extends \PhraseanetPHPUnitAuthenticatedAbstract
$tagname = $attribute->getValue()->getTag()->getTagname(); $tagname = $attribute->getValue()->getTag()->getTagname();
if ( ! isset($foundMeta[$tagname])) { if (!isset($foundMeta[$tagname])) {
$foundMeta[$tagname] = array(); $foundMeta[$tagname] = array();
} }
@@ -316,7 +318,7 @@ class ManagerTest extends \PhraseanetPHPUnitAuthenticatedAbstract
$fieldname = $attribute->getField()->get_name(); $fieldname = $attribute->getField()->get_name();
if ( ! isset($foundField[$fieldname])) { if (!isset($foundField[$fieldname])) {
$foundField[$fieldname] = array(); $foundField[$fieldname] = array();
} }
@@ -326,11 +328,11 @@ class ManagerTest extends \PhraseanetPHPUnitAuthenticatedAbstract
} }
} }
if (! $story_found) { if (!$story_found) {
$this->fail('Story is not found'); $this->fail('Story is not found');
} }
if (! $status_found) { if (!$status_found) {
$this->fail('Status is not found'); $this->fail('Status is not found');
} }
@@ -348,7 +350,6 @@ class ManagerTest extends \PhraseanetPHPUnitAuthenticatedAbstract
} }
} }
//
/** /**
* @covers Alchemy\Phrasea\Border\Manager::process * @covers Alchemy\Phrasea\Border\Manager::process
*/ */