예제 #1
0
<?php

include dirname(__FILE__) . '/../../bootstrap/functional.php';
$browser = new dnTestFunctional(new sfBrowser());
$neededStuff = csFactory::create('StuffResource', array('transaction_type' => 'need', 'title' => csFactory::generate('Stuff Resource '), 'owner_id' => csFactory::selectRandomId('sfGuardUser')));
$neededStuff->save();
$browser->get('/')->click('I Have')->isModuleAction('resource', 'have')->click('Stuff')->isModuleAction('stuff', 'have')->info('first we will look for something that is a have-resource, a pump, and expect no results')->call('/stuff/list', 'post', $parameters = array('q' => 'pump', 'type' => 'need'))->isModuleAction('resource', 'stuffList')->info('you have a pump? yeah so do we.')->with('response')->begin()->matches('!/pump/i')->end()->call('/stuff/list', 'post', $parameters = array('q' => 'picnic', 'type' => 'need'))->isModuleAction('resource', 'stuffList')->with('response')->begin()->matches('/picnic/i')->end()->call('/stuff/list', 'post', $parameters = array('q' => $neededStuff['title'], 'type' => 'need'))->isModuleAction('resource', 'stuffList')->with('response')->begin()->matches(sprintf('/%s/i', $neededStuff['title']))->end()->get(sprintf('/have/stuff/%s', $neededStuff['id']))->isModuleAction('stuff', 'show')->with('response')->begin()->matches(sprintf('/%s/', $neededStuff['title']))->end();
예제 #2
0
<?php

include dirname(__FILE__) . '/../../bootstrap/functional.php';
$browser = new dnTestFunctional(new sfBrowser());
$browser->get('/')->click('I Need')->isModuleAction('resource', 'need')->click('A Hand')->isModuleAction('time', 'addNeed');
예제 #3
0
<?php

include dirname(__FILE__) . '/../../bootstrap/functional.php';
$browser = new dnTestFunctional(new sfBrowser());
$neededTime = csFactory::create('TimeResource', array('transaction_type' => 'need', 'title' => csFactory::generate('Time Resource '), 'owner_id' => csFactory::selectRandomId('sfGuardUser')));
$neededTime['resource_date'] = date('Y-m-d');
$neededTime->save();
$browser->get('/')->click('I Have')->isModuleAction('resource', 'have')->click('Time')->isModuleAction('time', 'have')->call('/time/list', 'post', $parameters = array('start' => date('Y-m-d')))->isModuleAction('resource', 'timeList')->with('response')->begin()->matches(sprintf('/%s/i', $neededTime['title']))->end()->get(sprintf('/have/time/%s', $neededTime['id']))->isModuleAction('time', 'show')->with('response')->begin()->matches(sprintf('/%s/', $neededTime['title']))->end();
예제 #4
0
<?php

include dirname(__FILE__) . '/../../bootstrap/functional.php';
$browser = new dnTestFunctional(new sfBrowser());
$browser->get('/')->click('I Need')->isModuleAction('resource', 'need')->click('A Place')->isModuleAction('resource', 'place')->with('response')->begin()->matches('/FEMA/')->end();
예제 #5
0
<?php

include dirname(__FILE__) . '/../../bootstrap/functional.php';
$browser = new dnTestFunctional(new sfBrowser());
$availableStuff = csFactory::create('StuffResource', array('transaction_type' => 'have', 'title' => csFactory::generate('Stuff Resource '), 'owner_id' => csFactory::selectRandomId('sfGuardUser')));
$availableStuff->save();
// Delete all existing data
$browser->get('/')->click('I Need')->isModuleAction('resource', 'need')->click('Stuff')->isModuleAction('stuff', 'need')->info('first we will look for something that is a needed resource, a picnic table, and expect no results')->call('/stuff/list', 'post', $parameters = array('q' => 'picnic', 'type' => 'have'))->isModuleAction('resource', 'stuffList')->info('you need a picnic table? yeah well so does everyone else')->with('response')->begin()->matches('!/picnic/i')->end()->call('/stuff/list', 'post', $parameters = array('q' => 'pump', 'type' => 'have'))->isModuleAction('resource', 'stuffList')->with('response')->begin()->matches('/sump/i')->end()->call('/stuff/list', 'post', $parameters = array('q' => $availableStuff['title'], 'type' => 'have'))->isModuleAction('resource', 'stuffList')->with('response')->begin()->matches(sprintf('/%s/i', $availableStuff['title']))->end()->get(sprintf('/need/stuff/%s', $availableStuff['id']))->isModuleAction('stuff', 'show')->with('response')->begin()->matches(sprintf('/%s/', $availableStuff['title']))->end();
$resource = Doctrine_Core::getTable('stuffResource')->findOneByTitle('Sump Pump');
$browser->get(sprintf('/need/stuff/%s', $resource['id']))->isModuleAction('stuff', 'show')->with('response')->begin()->matches(sprintf('/%s/', $resource['title']))->checkForm('ContactResourceOwnerForm')->end()->setField('contact[email]', '*****@*****.**')->setField('contact[name]', 'Lacy')->setField('contact[phone]', '12345')->setField('contact[notes]', 'Takin notes!')->click('#resource-contact-submit')->with('form')->begin()->hasErrors(false)->end()->with('mailer')->begin()->hasSent(true)->withMessage($resource->User->username)->end()->with('doctrine')->begin()->check('Contact', array('resource_id' => $resource['id'], 'resource_type' => $resource['type']))->end();