public function test_delete_ok() { $oldCount = CollaborationPeer::doCount(new Criteria()); $this->goto_edit(); $this->b->click('delete')->isRedirected()->followRedirect()->checkResponseElement('body', '/Collaborations/')->checkResponseElement('body', '!/' . $this->Collaborations['c1']['name'] . '/'); $this->b->test()->is($oldCount - 1, CollaborationPeer::doCount(new Criteria()), "Collaboration count should still be one less than {$oldCount}"); }
public function test_create_fails() { $oldCount = CollaborationPeer::doCount(new Criteria()); $organizations = OrganizationPeer::doSelect(new Criteria()); $organization1_id = $organizations[0]->getId(); $this->b->test()->ok($organization1_id, "Should get organization " . $organization1_id); $this->b->get('/collaboration/list')->checkResponseElement('body', '/Collaboration/')->checkResponseElement('body', '/Name/'); $this->b->click('Create Collaboration')->checkResponseElement('body', '/Create Collaboration/'); $this->b->click('save', array('name' => 'Collabor 101', 'collaboratingOrganizations' => array($organization1_id)))->checkResponseElement('body', '/Create Collaboration/')->checkResponseElement('body', '/Collaboration must contain at least two organizations/'); $this->b->test()->is($oldCount, CollaborationPeer::doCount(new Criteria()), "Collaboration count should still be {$oldCount}"); }
public function test_create_ok() { $oldCount = CollaborationPeer::doCount(new Criteria()); $organizations = OrganizationPeer::doSelect(new Criteria()); $organization1_id = $organizations[0]->getId(); $organization2_id = $organizations[1]->getId(); $this->b->test()->ok($organization1_id, "Should get organization " . $organization1_id); $this->b->test()->ok($organization2_id, "Should get organization " . $organization2_id); $this->b->get('/collaboration/list')->checkResponseElement('body', '/Collaboration/')->checkResponseElement('body', '/Name/'); $this->b->click('Create Collaboration')->checkResponseElement('body', '/Create Collaboration/'); $this->b->click('save', array('name' => 'Kenglish', 'collaboratingOrganizations' => array($organization1_id, $organization2_id), 'collaborationYears' => array(2000, 2009)))->isRedirected()->followRedirect()->checkResponseElement('body', '/View Collaboration/')->checkResponseElement('body', '/Kenglish/'); $this->b->test()->is($oldCount + 1, CollaborationPeer::doCount(new Criteria()), "Collaboration count should be " . ($oldCount + 1)); }