コード例 #1
0
<?php

$app = 'qubit';
include dirname(__FILE__) . '/../../../bootstrap/functional.php';
$browser = new QubitTestFunctional(new sfBrowser());
$browser->info('Information object without parent is 404')->get(QubitInformationObject::ROOT_ID . ';edit/isad')->with('request')->begin()->isParameter('module', 'sfIsadPlugin')->isParameter('action', 'edit')->end()->with('response')->begin()->isStatusCode(404)->end();
コード例 #2
0
<?php

$app = 'qubit';
include dirname(__FILE__) . '/../../../bootstrap/functional.php';
$browser = new QubitTestFunctional(new sfBrowser());
$browser->disableSecurity();
$browser->info('Actor without parent is 404')->get(QubitActor::ROOT_ID . ';actor/delete')->with('request')->begin()->isParameter('module', 'actor')->isParameter('action', 'delete')->end()->with('response')->begin()->isStatusCode(404)->end();
コード例 #3
0
<?php

$app = 'qubit';
include dirname(__FILE__) . '/../../../bootstrap/functional.php';
$browser = new QubitTestFunctional(new sfBrowser());
$browser->info('Actor without parent is 404')->get(QubitActor::ROOT_ID . ';isaar')->with('request')->begin()->isParameter('module', 'actor')->isParameter('action', 'indexIsaar')->end()->with('response')->begin()->isStatusCode(404)->end();
コード例 #4
0
ファイル: eadTest.php プロジェクト: nurfiantara/ehri-ica-atom
<?php

$app = 'qubit';
include dirname(__FILE__) . '/../../../bootstrap/functional.php';
class Browser extends sfBrowser
{
    public function files($files)
    {
        foreach ($files as $key => $path) {
            $error = UPLOAD_ERR_NO_FILE;
            $size = 0;
            if (is_readable($path)) {
                $error = UPLOAD_ERR_OK;
                $size = filesize($path);
            }
            $this->files[$key] = array('error' => $error, 'name' => basename($path), 'size' => $size, 'tmp_name' => $path, 'type' => '');
        }
        return $this;
    }
}
$browser = new QubitTestFunctional(new Browser());
$browser->disableSecurity();
$browser->files(array('file' => dirname(__FILE__) . '/../../../fixtures/ead.xml'))->post(';object/import')->with('request')->begin()->isParameter('module', 'object')->isParameter('action', 'import')->end()->click('View Information object')->with('request')->begin()->isParameter('module', 'sfIsadPlugin')->isParameter('action', 'index')->end();
$object = QubitObject::getById($browser->getRequest()->id);
$browser->test()->ok(isset($object->parent), 'Never create an information object without a parent');
$creators = $object->getCreators();
$browser->test()->ok(isset($creators[0]->parent), 'Never create an actor without a parent');
$object->delete();
$object->events[0]->delete();
$creators[0]->delete();
コード例 #5
0
ファイル: addTest.php プロジェクト: nurfiantara/ehri-ica-atom
<?php

$app = 'qubit';
include dirname(__FILE__) . '/../../../bootstrap/functional.php';
$browser = new QubitTestFunctional(new sfBrowser());
$browser->disableSecurity();
$browser->post(';create/isad', array('title' => 'Example fonds'))->with('request')->begin()->isParameter('module', 'sfIsadPlugin')->isParameter('action', 'edit')->end()->isRedirected()->followRedirect()->with('request')->begin()->isParameter('module', 'sfIsadPlugin')->isParameter('action', 'index')->end()->with('response')->begin()->checkElement('body', '/Example fonds/')->end();
$object = QubitObject::getById($browser->getRequest()->id);
$browser->test()->ok(isset($object->parent), 'Never create an information object without a parent');
$object->delete();
コード例 #6
0
ファイル: addTest.php プロジェクト: nurfiantara/ehri-ica-atom
<?php

$app = 'qubit';
require_once dirname(__FILE__) . '/../../../bootstrap/functional.php';
$browser = new QubitTestFunctional(new sfBrowser());
$browser->disableSecurity();
$browser->get(';create/isaar')->with('request')->begin()->isParameter('module', 'actor')->isParameter('action', 'editIsaar')->end()->click('Create')->with('request')->begin()->isParameter('module', 'actor')->isParameter('action', 'editIsaar')->end()->isRedirected()->followRedirect()->with('request')->begin()->isParameter('module', 'actor')->isParameter('action', 'indexIsaar')->end();
$object = QubitObject::getById($browser->getRequest()->id);
$browser->test()->ok(isset($object->parent), 'Never create an actor without a parent');
$object->delete();
コード例 #7
0
<?php

$app = 'qubit';
include dirname(__FILE__) . '/../../../bootstrap/functional.php';
$browser = new QubitTestFunctional(new sfBrowser());
$browser->info('Information object without parent is 404')->get(QubitInformationObject::ROOT_ID . ';informationobject/delete')->with('request')->begin()->isParameter('module', 'informationobject')->isParameter('action', 'delete')->end()->with('response')->begin()->isStatusCode(404)->end();