public function test_create_fails()
 {
     $oldCount = OrganizationPeer::doCount(new Criteria());
     $this->b->get('/organization/list')->checkResponseElement('body', '/Organization/')->checkResponseElement('body', '/Name/');
     $this->b->click('Create Organization')->checkResponseElement('body', '/Create Organization/');
     $this->b->test()->is($oldCount, OrganizationPeer::doCount(new Criteria()), "Organization count should still be {$oldCount}");
 }
 public function test_delete_ok()
 {
     $oldCount = OrganizationPeer::doCount(new Criteria());
     $this->goto_edit();
     $this->b->click('delete')->isRedirected()->followRedirect()->checkResponseElement('body', '/Organizations/')->checkResponseElement('body', '!/' . $this->Organizations['o1']['name'] . '/');
     $this->b->test()->is($oldCount - 1, OrganizationPeer::doCount(new Criteria()), "Organization count should be one less than {$oldCount}");
     echo "org is " . $this->Organizations['o1']['name'] . "\n";
 }
 public function test_create_ok()
 {
     $oldCount = OrganizationPeer::doCount(new Criteria());
     $this->b->get('/organization/list')->checkResponseElement('body', '/Organization/')->checkResponseElement('body', '/Name/');
     $this->b->click('Create Organization')->checkResponseElement('body', '/Create Organization/');
     $this->b->click('save', array('name' => 'my new org'))->isRedirected()->followRedirect()->checkResponseElement('body', '/View Organization/');
     $this->b->test()->is($oldCount + 1, OrganizationPeer::doCount(new Criteria()), "Organization count should still be " . ($oldCount + 1));
 }
 public function countOrganizations($criteria = null, $distinct = false, $con = null)
 {
     include_once 'lib/model/om/BaseOrganizationPeer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     $criteria->add(OrganizationPeer::ORGANIZATION_TYPE_ID, $this->getId());
     return OrganizationPeer::doCount($criteria, $distinct, $con);
 }