Files
Phraseanet/lib/unitTest/Alchemy/Phrasea/Controller/Prod/MoveCollectionTest.php
2012-01-26 12:32:37 +01:00

65 lines
1.4 KiB
PHP

<?php
require_once __DIR__ . '/../../../../PhraseanetWebTestCaseAuthenticatedAbstract.class.inc';
/**
* Test class for MoveCollection.
* Generated by PHPUnit on 2012-01-11 at 18:24:28.
*/
class ControllerMoveCollectionTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
{
/**
* As controllers use WebTestCase, it requires a client
*/
protected $client;
/**
* If the controller tests require some records, specify it her
*
* For example, this will loacd 2 records
* (self::$record_1 and self::$record_2) :
*
* $need_records = 2;
*
*/
protected static $need_records = 1;
/**
* The application loader
*/
public function createApplication()
{
return require __DIR__ . '/../../../../../Alchemy/Phrasea/Application/Prod.php';
}
public function setUp()
{
parent::setUp();
$this->client = $this->createClient();
}
/**
* Default route test
*/
public function testRouteSlash()
{
$this->client->request('POST', '/records/movecollection/', array('lst' => self::$record_1->get_serialize_key()));
$response = $this->client->getResponse();
$this->assertTrue($response->isOk());
}
public function testApply()
{
$this->client->request('POST', '/records/movecollection/apply/', array('lst' => self::$record_1->get_serialize_key(), 'base_id' => self::$collection->get_base_id()));
$response = $this->client->getResponse();
$this->assertTrue($response->isOk());
}
}