<?php

include dirname(__FILE__) . '/../../bootstrap/functional.php';
$browser = new DarwinTestFunctional(new sfBrowser());
$browser->loadData($configuration)->login('root', 'evil');
$browser->info('executeSearch')->get('/catalogue/search?searchCatalogue[name]=falco&searchCatalogue[table]=taxonomy')->with('request')->begin()->isParameter('module', 'catalogue')->isParameter('action', 'search')->end()->with('response')->begin()->isStatusCode(200)->checkElement('table tbody tr', 9)->checkElement('tbody tr:first span', '/Falco Class/')->end()->info('executeTree');
$items = Doctrine::getTable('Taxonomy')->findByName('Falco Peregrinus (Duchesnus Brulus 1912)');
$browser->get('/catalogue/tree?table=taxonomy&id=' . $items[0]->getId())->with('response')->begin()->isStatusCode(200)->checkElement('body > div.wrapper > ul > li', 8)->checkElement('body > div.wrapper > ul li:first', '/Eucaryota/')->checkElement('body > div.wrapper > ul li:last', '/Duchesnus/')->end()->info('Relation');
$items = Doctrine::getTable('CatalogueRelationships')->getRelationsForTable('taxonomy', 4, 'current_name');
$browser->get('/catalogue/relation?type=rename&table=taxonomy&rid=4&id=' . $items[0]['id'])->with('response')->begin()->isStatusCode(200)->checkElement('label[for="catalogue_relationships_record_id_2"]', 'Renamed in')->checkElement('form')->checkElement('input[id="catalogue_relationships_record_id_2_name"][value="Falco Peregrinus Tunstall, 1771"]')->end();
$items = Doctrine::getTable('CatalogueRelationships')->getRelationsForTable('taxonomy', 4, 'recombined from');
$browser->get('/catalogue/relation?type=recombined&table=taxonomy&rid=4&id=' . $items[0]['id'])->with('response')->begin()->isStatusCode(200)->checkElement('label[for="catalogue_relationships_record_id_2"]', 'Recombined from')->checkElement('form')->checkElement('input[id="catalogue_relationships_record_id_2_name"][value="Falco Peregrinus recombinus"]')->end()->info('SaveRelation')->get('/catalogue/relation?type=recombined&table=taxonomy&rid=4')->with('response')->begin()->isStatusCode(200)->checkElement('label[for="catalogue_relationships_record_id_2"]', 'Recombined from')->checkElement('form')->checkElement('input[id="catalogue_relationships_record_id_2_name"][value=""]')->end()->click('Save', array('catalogue_relationships' => array('record_id_2' => '2', 'referenced_relation' => 'taxonomy', 'relationship_type' => 'recombined from', 'record_id_1' => '4')));
$browser->test()->like($browser->getResponse()->getContent(), '/ok/', 'Content is ok');
$items = Doctrine::getTable('CatalogueRelationships')->getRelationsForTable('taxonomy', 4, 'recombined from');
$tax = Doctrine::getTable('Taxonomy')->find($items[1]['record_id_2']);
$browser->get('/catalogue/relation?type=recombined&table=taxonomy&rid=4&id=' . $items[1]['id'])->with('response')->begin()->isStatusCode(200)->checkElement('label[for="catalogue_relationships_record_id_2"]', 'Recombined from')->checkElement('form')->checkElement('input[id="catalogue_relationships_record_id_2_name"]')->checkElement('input[id="catalogue_relationships_record_id_2_name"][value="' . $tax->getName() . '"]')->end()->info('DeleteRelated')->get('/catalogue/deleteRelated?table=catalogue_relationships&id=' . $items[1]['id'])->with('response')->begin()->isStatusCode(200)->end()->get('/catalogue/relation?type=recombined&table=taxonomy&rid=4&id=' . $items[1]['id'])->with('response')->begin()->isStatusCode(200)->checkElement('label[for="catalogue_relationships_record_id_2"]', 'Recombined from')->checkElement('form')->checkElement('#relation_catalogue_name', '')->end();
$items = Doctrine::getTable('Taxonomy')->findByName('Falco Peregrinus (Duchesnus Brulus 1912)');
$parent_item = Doctrine::getTable('Taxonomy')->findOneByLevelRef(48);
$items[0]->setParentRef($parent_item->getId());
$items[0]->save();
$browser->info('Test the possible upper levels check function')->get('/catalogue/searchPUL/table/taxonomy/level_id/' . $items[0]->getLevelRef() . '/parent_id/' . $parent_item->getId())->with('response')->begin()->isStatusCode(200)->matches('/ok/')->end()->get('/catalogue/searchPUL/table/taxonomy/level_id/20/parent_id/' . $parent_item->getId())->with('response')->begin()->isStatusCode(200)->matches('/not ok/')->end()->get('/catalogue/searchPUL/table/taxonomy/level_id/50/parent_id/' . $parent_item->getId())->with('response')->begin()->isStatusCode(200)->matches('/ok/')->end()->get('/catalogue/searchPUL/table/taxonomy/level_id/1/parent_id/' . $parent_item->getId())->with('response')->begin()->isStatusCode(200)->matches('/top/')->end();
<?php

include dirname(__FILE__) . '/../../bootstrap/functional.php';
$browser = new DarwinTestFunctional(new sfBrowser());
$browser->loadData($configuration)->login('root', 'evil');
$browser->info('Index')->get('/people/index')->with('request')->begin()->isParameter('module', 'people')->isParameter('action', 'index')->end()->with('response')->begin()->isStatusCode(200)->checkElement('.search_results_content')->checkElement('#people_filters_family_name')->end()->click('.search_submit', array('people_filters' => array('family_name' => 'poil', 'is_physical' => 1)))->with('response')->begin()->isStatusCode(200)->checkElement('.results_container')->checkElement('.results_container .results > tbody > tr', 2)->checkElement('.results_container .results > tbody > tr.hidden', 1)->end()->get('/people/index')->click('.search_submit', array('people_filters' => array('family_name' => 'ntol', 'is_physical' => 1)))->with('response')->begin()->isStatusCode(200)->end();
$browser->test()->like($browser->getResponse()->getContent(), '/No Matching Items/', 'Content is ok');
$browser->get('/people/index')->click('New')->with('response')->begin()->isStatusCode(200)->end()->click('Save', array('people' => array('family_name' => '', 'additional_names' => '')))->with('form')->begin()->hasErrors(1)->isError('family_name', 'required')->end()->click('Save', array('people' => array('family_name' => 'Dupont', 'additional_names' => 'jr')))->with('response')->begin()->isRedirected()->end()->followRedirect();
$nitems = Doctrine::getTable('People')->findByAdditionalNames('jr');
$browser->test()->is($nitems[0]->getFamilyName(), 'Dupont', 'We have the new encoded people');
$browser->with('request')->begin()->isParameter('module', 'people')->isParameter('action', 'edit')->end()->with('response')->begin()->isStatusCode(200)->end()->click('Save', array('people' => array('family_name' => 'Dupond', 'additional_names' => 'jr')))->with('response')->begin()->isRedirected()->end()->followRedirect()->with('request')->begin()->isParameter('module', 'people')->isParameter('action', 'edit')->end()->with('response')->begin()->isStatusCode(200)->checkElement('input[value="Dupond"]')->end()->click('Delete')->with('response')->begin()->isRedirected()->end()->followRedirect()->with('request')->begin()->isParameter('module', 'people')->isParameter('action', 'index')->end()->with('response')->begin()->isStatusCode(200)->end();
$nitems = Doctrine::getTable('People')->findByAdditionalNames('jr');
$browser->test()->is($nitems->count(), 0, 'We have no matching people');
$browser->info('Address')->click('.search_submit', array('people_filters' => array('family_name' => 'poil', 'is_physical' => 1)))->click('td.edit a:nth-child(2)')->with('response')->begin()->isStatusCode(200)->checkElement('#address tbody tr', 0)->end()->click('#address a.link_catalogue')->with('response')->begin()->isStatusCode(200)->end()->click('Save')->with('response')->begin()->isStatusCode(200)->end()->with('form')->begin()->hasErrors(2)->isError('locality', 'required')->isError('country', 'required')->end()->click('Save', array('people_addresses' => array('locality' => 'Bruxelles', 'country' => 'Belgium', 'tag' => 'home,pref')))->with('response')->begin()->isStatusCode(200)->end();
$browser->test()->like($browser->getResponse()->getContent(), '/ok/', 'Content is ok');
$browser->get('/people/index')->click('.search_submit', array('people_filters' => array('family_name' => 'poil', 'is_physical' => 1)))->click('td.edit a:nth-child(2)')->with('response')->begin()->isStatusCode(200)->checkElement('#address tbody tr', 1)->checkElement('#address tbody tr .tag', 2)->end()->click('#address table tbody a.link_catalogue')->with('response')->begin()->isStatusCode(200)->checkElement('input[value="Bruxelles"]')->end()->click('.delete_button')->with('response')->begin()->isStatusCode(200)->end();
$browser->test()->like($browser->getResponse()->getContent(), '/ok/', 'Content is ok');
$browser->info('Comm')->get('/people/index')->click('.search_submit', array('people_filters' => array('family_name' => 'poil', 'is_physical' => 1)))->click('td.edit a:nth-child(2)')->with('response')->begin()->isStatusCode(200)->checkElement('#comm tbody tr', 0)->end()->click('#comm a.link_catalogue')->with('response')->begin()->isStatusCode(200)->end()->click('Save')->with('response')->begin()->isStatusCode(200)->end()->with('form')->begin()->hasErrors(1)->isError('entry', 'required')->end()->click('Save', array('people_comm' => array('entry' => '+32478.254415', 'comm_type' => 'phone/fax', 'tag' => 'home')))->with('response')->begin()->isStatusCode(200)->end();
$browser->test()->like($browser->getResponse()->getContent(), '/ok/', 'Content is ok');
$browser->get('/people/index')->click('.search_submit', array('people_filters' => array('family_name' => 'poil', 'is_physical' => 1)))->click('td.edit a:nth-child(2)')->with('response')->begin()->isStatusCode(200)->checkElement('#comm tbody tr', 1)->checkElement('#comm tbody tr .tag', 'Home')->end()->click('#comm table tbody a.link_catalogue')->with('response')->begin()->isStatusCode(200)->checkElement('input[value="+32478.254415"]')->end()->click('.delete_button')->with('response')->begin()->isStatusCode(200)->end();
$browser->test()->like($browser->getResponse()->getContent(), '/ok/', 'Content is ok');
$browser->info('Relation')->get('/people/index')->click('.search_submit', array('people_filters' => array('family_name' => 'poil', 'is_physical' => 1)))->click('td.edit a:nth-child(2)')->with('response')->begin()->isStatusCode(200)->checkElement('#relation tbody tr', 0)->end()->click('#relation a.link_catalogue')->with('response')->begin()->isStatusCode(200)->end()->click('Save')->with('response')->begin()->isStatusCode(200)->end()->with('form')->begin()->hasErrors(1)->isError('person_1_ref', 'required')->end();
$nitems = Doctrine::getTable('Institutions')->findOneByFamilyName('UGMM');
$browser->click('Save', array('people_relationships' => array('person_1_ref' => $nitems->getId(), 'relationship_type' => 'work for', 'person_user_role' => 'Manager')))->with('response')->begin()->isStatusCode(200)->end();
$browser->test()->like($browser->getResponse()->getContent(), '/ok/', 'Content is ok');
$browser->get('/people/index')->click('.search_submit', array('people_filters' => array('family_name' => 'poil', 'is_physical' => 1)))->click('td.edit a:nth-child(2)')->with('response')->begin()->isStatusCode(200)->checkElement('#relation tbody tr', 1)->end()->click('#relation table tbody a.link_catalogue')->with('response')->begin()->isStatusCode(200)->checkElement('input[value="Manager"]')->end()->click('.delete_button')->with('response')->begin()->isStatusCode(200)->end();
$browser->test()->like($browser->getResponse()->getContent(), '/ok/', 'Content is ok');
$browser->info('Lang')->get('/people/index')->click('.search_submit', array('people_filters' => array('family_name' => 'poil', 'is_physical' => 1)))->click('td.edit a:nth-child(2)')->with('response')->begin()->isStatusCode(200)->checkElement('#lang tbody tr', 0)->end()->click('#lang a.link_catalogue')->with('response')->begin()->isStatusCode(200)->end()->click('Save', array('people_languages' => array('language_country' => 'ddddddd', 'mother' => '')))->with('response')->begin()->isStatusCode(200)->end()->with('form')->begin()->hasErrors(1)->isError('language_country', 'invalid')->end();
$browser->click('Save', array('people_languages' => array('language_country' => 'am', 'mother' => 'yes', 'preferred_language' => 'yes')))->with('response')->begin()->isStatusCode(200)->end();
$browser->test()->like($browser->getResponse()->getContent(), '/ok/', 'Content is ok');
$browser->get('/people/index')->click('.search_submit', array('people_filters' => array('family_name' => 'poil', 'is_physical' => 1)))->click('td.edit a:nth-child(2)')->with('response')->begin()->isStatusCode(200)->checkElement('#lang tbody tr', 1)->checkElement('#lang tbody tr td:first', '/Preferred/')->end()->click('#lang .widget_content > a.link_catalogue')->click('Save', array('people_languages' => array('language_country' => 'fr', 'mother' => '', 'preferred_language' => 'yes')))->with('response')->begin()->isStatusCode(200)->end();
<?php

include dirname(__FILE__) . '/../../bootstrap/functional.php';
$browser = new DarwinTestFunctional(new sfBrowser());
$browser->loadData($configuration)->login('root', 'evil');
$vernacular_names = new VernacularNames();
$vernacular_names->setCommunity('French');
$vernacular_names->setReferencedRelation('taxonomy');
$vernacular_names->setRecordId(4);
$vernacular_names->name = 'Faux con';
$vernacular_names->save();
$personId = Doctrine::getTable('People')->findOneByFamilyNameAndGivenName('Root', 'Evil')->getId();
$catalogue_people = new CataloguePeople();
$catalogue_people->setReferencedRelation('taxonomy');
$catalogue_people->setRecordId(4);
$catalogue_people->setPeopleType('authors');
$catalogue_people->setPeopleSubType('Main authors');
$catalogue_people->setPeopleRef($personId);
$catalogue_people->save();
$browser->info('2 - Recombined')->get('/widgets/reloadContent?widget=relationRecombination&category=catalogue_taxonomy&eid=4')->with('response')->begin()->isStatusCode(200)->checkElement('table tbody tr', 1)->checkElement('table tbody tr td:first a.link_catalogue', '/recombinus/')->checkElement('img', 3)->end();
$items = Doctrine::getTable('CatalogueRelationships')->getRelationsForTable('taxonomy', 4, 'current_name');
$browser->get('/catalogue/deleteRelated?table=catalogue_relationships&id=' . $items[0]['id'])->with('response')->begin()->isStatusCode(200)->end();
$browser->info('3 - Comment')->get('/widgets/reloadContent?widget=comment&category=catalogue_taxonomy&eid=4')->with('response')->begin()->isStatusCode(200)->checkElement('table tr', 2)->checkElement('table tr:last a.link_catalogue', '/taxon information/')->checkElement('table tr:last td:nth-child(2)', '/This is bullshit/')->end()->info('4 - Properties')->get('/widgets/reloadContent?widget=properties&category=catalogue_taxonomy&eid=4')->with('response')->begin()->isStatusCode(200)->checkElement('table tbody tr', 2)->checkElement('table tbody tr:first td:first', '/physical measurement/')->checkElement('table tbody tr:last td:first', '/protection status/')->end()->info('5 - Vernacular Names')->get('/widgets/reloadContent?widget=vernacularNames&category=catalogue_taxonomy&eid=4')->with('response')->begin()->isStatusCode(200)->checkElement('table tbody tr', 1)->checkElement('table tbody tr:first td:first', '/French/')->checkElement('table tbody tr:first td::nth-child(2)', '/Faux con/')->end()->info('6 - Synonymies')->get('/widgets/reloadContent?widget=synonym&category=catalogue_taxonomy&eid=4')->with('response')->begin()->isStatusCode(200)->checkElement('table.catalogue_table tbody table[alt="homonym"]', 1)->checkElement('table.catalogue_table tbody table[alt="synonym"]', 1)->checkElement('table.catalogue_table tbody table[alt="synonym"] tbody tr', 2)->checkElement('table.catalogue_table tbody table[alt="synonym"] tbody td:first[class="handle"]', 1)->checkElement('table.catalogue_table tbody table[alt="synonym"] tbody td:nth-child(2)', '/Duchesnus Brulus 1912/')->checkElement('table.catalogue_table tbody table[alt="synonym"] tbody tr:first td:nth-child(3)[class="basio_cell"]', 1)->checkElement('table.catalogue_table tbody table[alt="synonym"] tbody tr:first td:nth-child(4)[class="widget_row_delete"]', 1)->end();
$items = Doctrine::getTable('ClassificationSynonymies')->findOneByReferencedRelationAndRecordId('taxonomy', 4);
$browser->info('8 - Synonymies after a delete')->get('/synonym/delete?id=' . $items['id'])->with('response')->begin()->isStatusCode(200)->matches('/ok/')->end()->get('/widgets/reloadContent?widget=synonym&category=catalogue_taxonomy&eid=4')->with('response')->begin()->isStatusCode(200)->checkElement('table.catalogue_table tbody table[alt="homonym"]', 1)->checkElement('table.catalogue_table tbody table[alt="synonym"]', 0)->end()->info('9 - People related')->get('/widgets/reloadContent?widget=cataloguePeople&category=catalogue_taxonomy&eid=4')->with('response')->begin()->isStatusCode(200)->checkElement('table[class="widget_sub_table"] tbody td:first[class="handle"]', 1)->checkElement('table[class="widget_sub_table"] tbody td:nth-child(2)', '/Root Evil/')->checkElement('table[class="widget_sub_table"] tbody td:nth-child(3)[class="catalogue_people_sub_type"]', 1)->checkElement('table[class="widget_sub_table"] tbody td:last[class="widget_row_delete"]', 1)->end()->click('table[class="widget_sub_table"] tbody td:last[class="widget_row_delete"] > a')->with('response')->begin()->isStatusCode(200)->matches('/ok/')->end()->get('/widgets/reloadContent?widget=cataloguePeople&category=catalogue_taxonomy&eid=4')->with('response')->begin()->isStatusCode(200)->checkElement('table[class="widget_sub_table"]', 0)->end();
<?php

include dirname(__FILE__) . '/../../bootstrap/functional.php';
$browser = new DarwinTestFunctional(new sfBrowser());
$browser->loadData($configuration)->login('root', 'evil');
$browser->get('/property/add?id=4&table=taxonomy')->with('response')->begin()->isStatusCode(200)->checkElement('#properties_property_type option', 3)->checkElement('#properties_applies_to option', 2)->checkElement('#properties_property_unit option', 2)->end()->click('Save', array('properties' => array('referenced_relation' => 'taxonomy', 'record_id' => '4', 'property_type' => '', 'applies_to' => '', 'date_from' => '', 'date_to' => '', 'method' => '', 'property_accuracy' => '', 'property_unit' => '')))->with('form')->begin()->hasErrors(1)->isError('property_type', 'required')->end()->click('Save', array('properties' => array('referenced_relation' => 'taxonomy', 'record_id' => '4', 'property_type' => 'size', 'date_from' => '', 'date_to' => '', 'method' => '', 'property_unit' => 'm²', 'lower_value' => '12', 'property_accuracy' => '10')))->with('response')->begin()->isStatusCode(200)->matches('/ok/')->end()->get('/property/getUnit?type=size')->with('response')->begin()->isStatusCode(200)->checkElement('option', 2)->end();
<?php

include dirname(__FILE__) . '/../../bootstrap/functional.php';
$browser = new DarwinTestFunctional(new sfBrowser());
$browser->loadData($configuration)->login('root', 'evil');
$browser->get('/specimensearch/index')->with('request')->begin()->isParameter('module', 'specimensearch')->isParameter('action', 'index')->end()->with('response')->begin()->isStatusCode(200)->checkElement('body', '!/This is a temporary page/')->checkElement('ul#taxon_child_syn_included input[name="specimen_search_filters[taxon_child_syn_included]"][type="checkbox"]')->checkElement('ul#taxon_child_syn_included input[name="specimen_search_filters[taxon_child_syn_included]"][type="checkbox"][checked="checked"]', '')->end();
<?php

include dirname(__FILE__) . '/../../bootstrap/functional.php';
$browser = new DarwinTestFunctional(new sfBrowser());
$browser->loadData($configuration)->login('root', 'evil');
$browser->info('Index')->get('/comment/comment?id=4&table=taxonomy')->with('request')->begin()->isParameter('module', 'comment')->isParameter('action', 'comment')->end()->with('response')->begin()->isStatusCode(200)->checkElement('.delete_button', false)->checkElement('textarea', '')->end()->click('Save', array('comments' => array('referenced_relation' => 'taxonomy', 'record_id' => '4', 'notion_concerned' => 'taxon life history', 'comment' => 'This is ok...
There is a thing')))->with('request')->begin()->isParameter('module', 'comment')->isParameter('action', 'comment')->end();
$browser->test()->like($browser->getResponse()->getContent(), '/ok/', 'Content is ok');
$item = Doctrine_Query::create()->from('Comments c')->andWhere("c.referenced_relation = 'taxonomy'")->andWhere("c.notion_concerned = 'taxon life history' ")->andWhere('c.record_id=4')->fetchOne();
$browser->test()->isnt($item, null, 'We add an item');
$browser->info('Update')->get('/comment/comment?id=4&table=taxonomy&cid=' . $item->getId())->with('request')->begin()->isParameter('module', 'comment')->isParameter('action', 'comment')->end()->with('response')->begin()->isStatusCode(200)->checkElement('.delete_button')->checkElement('textarea', '/There is a thing/')->end()->click('Save', array('comments' => array('referenced_relation' => 'taxonomy', 'record_id' => '4', 'notion_concerned' => 'taxon life history', 'comment' => 'This is not ok...')))->with('request')->begin()->isParameter('module', 'comment')->isParameter('action', 'comment')->end();
$browser->test()->like($browser->getResponse()->getContent(), '/ok/', 'Content is ok');
$browser->get('/comment/comment?id=4&table=taxonomy&cid=' . $item->getId())->with('request')->begin()->isParameter('module', 'comment')->isParameter('action', 'comment')->end()->with('response')->begin()->isStatusCode(200)->checkElement('.delete_button')->checkElement('textarea', 'This is not ok...')->end()->info('Delete')->click('.delete_button')->with('response')->begin()->isStatusCode(200)->end();
$browser->test()->like($browser->getResponse()->getContent(), '/ok/', 'Content is ok');
$item = Doctrine_Query::create()->from('Comments c')->andWhere("c.referenced_relation = 'taxonomy'")->andWhere("c.notion_concerned = 'taxon life history' ")->andWhere('c.record_id=4')->fetchOne();
$browser->test()->is($item, null, 'there is no more item');
<?php

include dirname(__FILE__) . '/../../bootstrap/functional.php';
$browser = new DarwinTestFunctional(new sfBrowser());
$browser->loadData($configuration)->login('root', 'evil');
$browser->get('/loan/edit?id=1')->info('Overview')->with('request')->begin()->isParameter('module', 'loan')->isParameter('action', 'edit')->end()->with('response')->begin()->isStatusCode(200)->checkElement('#tab_0', ' < Edit loan > ')->end()->click('Items overview')->with('request')->begin()->isParameter('module', 'loan')->isParameter('action', 'overview')->end()->with('response')->begin()->isStatusCode(200)->checkElement('.warn_message')->end()->click('Save', array('loan_overview' => array('newLoanItems' => array('0' => array('specimen_ref' => '', 'ig_ref' => '', 'details' => 'details message', 'item_visible' => 'true')))))->with('response')->begin()->isRedirected()->followredirect()->end()->with('request')->begin()->isParameter('module', 'loan')->isParameter('action', 'overview')->end()->with('response')->begin()->isStatusCode(200)->checkElement('.loan_overview_form tbody tr', 3)->checkElement('textarea', 'details message')->checkElement('img[title="View"]')->checkElement('img[title="Edit"]')->checkElement('.maint_butt')->end()->info('Add Maintenance')->get('/loanitem/maintenances?ids=' . Doctrine::getTable('LoanItems')->findOneByLoanRef(1)->getId())->with('response')->begin()->isStatusCode(200)->checkElement('h1', '/Add Maintenance/')->end()->click('Add Maintenance', array('collection_maintenance' => array('category' => 'observation', 'action_observation' => 'check', 'people_ref' => Doctrine::getTable('People')->findOneByGivenName('Poilux')->getId(), 'description' => 'Ok The package is checked!')))->with('response')->begin()->isStatusCode(200)->matches('/ok/')->end()->get('/loanitem/showmaintenances?id=' . Doctrine::getTable('LoanItems')->findOneByLoanRef(1)->getId())->with('response')->begin()->isStatusCode(200)->checkElement('.catalogue_table_view')->checkElement('.catalogue_table_view tbody tr', 1)->checkElement('.catalogue_table_view .delete_maint_button', 1)->end()->click('.delete_maint_button')->with('response')->begin()->isStatusCode(200)->matches('/ok/')->end()->get('/loanitem/showmaintenances?id=' . Doctrine::getTable('LoanItems')->findOneByLoanRef(1)->getId())->with('response')->begin()->isStatusCode(200)->checkElement('.catalogue_table_view')->checkElement('.catalogue_table_view tbody tr', 0)->checkElement('.catalogue_table_view .delete_maint_button', 0)->end()->info('Edit Loan Item Screen')->get('/loanitem/edit?id=' . Doctrine::getTable('LoanItems')->findOneByLoanRef(1)->getId())->with('response')->begin()->isStatusCode(200)->checkElement('#mainInfo')->checkElement('.loanitem_form')->end()->click('#submit_loan_item', array('loan_items' => array('receiver' => '1', 'sender' => '1', 'newActorsSender' => array(0 => array('people_ref' => Doctrine::getTable('People')->findOneByGivenName('Poilux')->getId(), 'people_type' => 'sender', 'people_sub_type' => array(2), 'order_by' => 1)), 'newActorsReceiver' => array(0 => array('people_ref' => Doctrine::getTable('People')->findOneByGivenName('Poilux')->getId(), 'people_type' => 'receiver', 'people_sub_type' => array(2, 4, 8), 'order_by' => 1)))))->with('response')->begin()->isRedirected()->end()->followRedirect()->with('response')->begin()->isStatusCode(200)->checkElement('#sender_body')->checkElement('#sender_body tr', 1)->end()->info('Delete Loan Item')->get('/loan/overview?id=1')->with('response')->begin()->isStatusCode(200)->checkElement('.loan_overview_form tbody tr', 3)->end()->click('Save', array('loan_overview' => array('LoanItems' => array('0' => array('specimen_ref' => '', 'ig_ref' => '', 'details' => 'details message2', 'item_visible' => '')))))->with('response')->begin()->isRedirected()->followredirect()->end()->with('response')->begin()->isStatusCode(200)->checkElement('.warn_message')->end();
<?php

include dirname(__FILE__) . '/../../bootstrap/functional.php';
$browser = new DarwinTestFunctional(new sfBrowser());
$browser->loadData($configuration)->login('root', 'evil');
$browser->get('/cataloguepeople/people?table=taxonomy&rid=3')->with('request')->begin()->isParameter('module', 'cataloguepeople')->isParameter('action', 'people')->end()->with('response')->begin()->isStatusCode(200)->checkElement('form')->checkElement('#catalogue_people_people_type option', 2)->checkElement('.tab_choice li', 2)->end()->click('Save')->with('form')->begin()->hasErrors(1)->isError('people_ref', 'required')->end();
$people = Doctrine::getTable('People')->findOneByFamilyName('Root');
$browser->click('Save', array('catalogue_people' => array('people_type' => 'expert', 'people_sub_type' => 'Main', 'record_id' => '3', 'people_ref' => $people->getId(), 'referenced_relation' => 'taxonomy')))->with('form')->begin()->hasErrors(0)->end();
$browser->test()->like($browser->getResponse()->getContent(), '/ok/', 'Content is ok');
$rbins = Doctrine::getTable('People')->findOneByFamilyName('Institut Royal des Sciences Naturelles de Belgique');
$rbins->save();
$browser->get('/cataloguepeople/people?table=taxonomy&rid=3')->click('Save', array('catalogue_people' => array('people_type' => 'author', 'people_sub_type' => 'Main', 'record_id' => '3', 'people_ref' => $rbins->getId(), 'referenced_relation' => 'taxonomy')))->with('form')->begin()->hasErrors(0)->end();
$browser->test()->like($browser->getResponse()->getContent(), '/ok/', 'Content is ok');
$browser->get('/widgets/reloadContent?widget=cataloguePeople&category=catalogue_taxonomy&eid=3')->with('response')->begin()->isStatusCode(200)->checkElement('table tr:nth-child(1) .widget_sub_table tbody tr', 2)->checkElement('table tr:nth-child(1) .widget_sub_table tbody tr:first td:nth-child(2)', '/Root/')->checkElement('table tr:nth-child(1) .widget_sub_table tbody tr:last td:nth-child(2)', '/Institut Royal des Sciences Naturelles de Belgique/')->end();
$rbins_recId = Doctrine_Query::create()->from('CataloguePeople c')->where('c.people_ref = ?', $rbins->getId())->andWhere('c.people_type=?', 'author')->fetchOne();
$root_recId = Doctrine_Query::create()->from('CataloguePeople c')->where('c.people_ref = ?', $people->getId())->andWhere('c.people_type=?', 'author')->fetchOne();
$browser->get('/cataloguepeople/editOrder?table=taxonomy&rid=3&people_type=author&order=' . $rbins_recId->getId() . ',' . $root_recId->getId() . ',')->with('response')->begin()->isStatusCode(200)->end();
$browser->test()->like($browser->getResponse()->getContent(), '/ok/', 'Content is ok');
$browser->get('/widgets/reloadContent?widget=cataloguePeople&category=catalogue_taxonomy&eid=3')->with('response')->begin()->isStatusCode(200)->checkElement('table tr:nth-child(1) .widget_sub_table tbody tr', 2)->checkElement('table tr:nth-child(1) .widget_sub_table tbody tr:first td:nth-child(2)', '/Institut Royal des Sciences Naturelles de Belgique/')->checkElement('table tr:nth-child(1) .widget_sub_table tbody tr:last td:nth-child(2)', '/Root/')->end();
$browser->get('/cataloguepeople/getSubType?type=author')->with('response')->begin()->isStatusCode(200)->end();
$browser->test()->like($browser->getResponse()->getContent(), '/Secondary Author/', 'Content is ok');
$browser->test()->like($browser->getResponse()->getContent(), '/Corrector/', 'Content is ok');
$browser->get('/cataloguepeople/getSubType?type=expert')->with('response')->begin()->isStatusCode(200)->end();
$browser->test()->like($browser->getResponse()->getContent(), '/Main/', 'Content is ok');
<?php

include dirname(__FILE__) . '/../../bootstrap/functional.php';
$browser = new DarwinTestFunctional(new sfBrowser());
$browser->loadData($configuration)->login('root', 'evil');
$browser->info('Index')->get('/institution/index')->with('request')->begin()->isParameter('module', 'institution')->isParameter('action', 'index')->end()->with('response')->begin()->isStatusCode(200)->checkElement('.search_results_content')->checkElement('#institutions_filters_family_name')->end()->click('.search_submit', array('institutions_filters' => array('family_name' => 'royal', 'is_physical' => 0)))->with('response')->begin()->isStatusCode(200)->checkElement('.results_container')->checkElement('.results_container tbody tr', 1)->end()->get('/institution/index')->click('.search_submit', array('institutions_filters' => array('family_name' => 'ntol', 'is_physical' => 0)))->with('response')->begin()->isStatusCode(200)->end();
$browser->test()->like($browser->getResponse()->getContent(), '/No Matching Items/', 'Content is ok');
$browser->get('/institution/index')->click('New')->with('response')->begin()->isStatusCode(200)->end()->click('Save', array('institutions' => array('family_name' => '', 'additional_names' => '', 'sub_type' => '')))->with('form')->begin()->hasErrors(1)->isError('family_name', 'required')->end()->click('Save', array('institutions' => array('family_name' => 'Banque Bruxelles Lambert', 'additional_names' => 'BBL', 'sub_type' => 'inc')))->with('response')->begin()->isRedirected()->end()->followRedirect();
$nitems = Doctrine::getTable('Institutions')->findByAdditionalNames('BBL');
$browser->test()->is($nitems[0]->getFamilyName(), 'Banque Bruxelles Lambert', 'We have the new encoded institution');
$browser->with('request')->begin()->isParameter('module', 'institution')->isParameter('action', 'edit')->end()->with('response')->begin()->isStatusCode(200)->end()->click('Save', array('institutions' => array('family_name' => 'Ing', 'additional_names' => 'Ing', 'sub_type' => 'inc')))->with('response')->begin()->isRedirected()->end()->followRedirect()->with('request')->begin()->isParameter('module', 'institution')->isParameter('action', 'edit')->end()->with('response')->begin()->isStatusCode(200)->checkElement('input[value="Ing"]')->end()->click('Delete')->with('response')->begin()->isRedirected()->end()->followRedirect()->with('request')->begin()->isParameter('module', 'institution')->isParameter('action', 'index')->end()->with('response')->begin()->isStatusCode(200)->end();
$nitems = Doctrine::getTable('Institutions')->findByAdditionalNames('Ing');
$browser->test()->is($nitems->count(), 0, 'We have no matching institutions');
<?php

include dirname(__FILE__) . '/../../bootstrap/functional.php';
$browser = new DarwinTestFunctional(new sfBrowser());
$browser->loadData($configuration)->login('root', 'evil');
$browser->get('/vernacularnames/vernacularnames?id=4&table=taxonomy')->with('response')->begin()->isStatusCode(200)->end()->click('Save', array('grouped_vernacular' => array('newVal' => array(0 => array('referenced_relation' => 'taxonomy', 'record_id' => '4', 'community' => '', 'name' => 'Test')))))->with('response')->begin()->isStatusCode(200)->end()->with('form')->begin()->hasErrors(1)->isError('newVal[0][community]', 'community')->end()->click('Save', array('grouped_vernacular' => array('newVal' => array(0 => array('referenced_relation' => 'taxonomy', 'record_id' => '4', 'community' => 'Français', 'name' => 'Faux con')))))->with('response')->begin()->isStatusCode(200)->matches('/ok/')->end()->get('/vernacularnames/addValue?num=12')->with('response')->begin()->isStatusCode(200)->checkElement('tr', 1)->checkElement('tr td', 3)->end();
$r = Doctrine::getTable('VernacularNames')->findForTable('taxonomy', 4);
$browser->get('/vernacularnames/addValue?num=13&id=' . $r[0]->getId())->with('response')->begin()->isStatusCode(200)->checkElement('tr', 1)->checkElement('tr td', 3)->end();
<?php

include dirname(__FILE__) . '/../../bootstrap/functional.php';
$browser = new DarwinTestFunctional(new sfBrowser());
$browser->loadData($configuration)->login('root', 'evil');
$browser->info('Search')->get('/user/index')->with('request')->begin()->isParameter('module', 'user')->isParameter('action', 'index')->end()->with('response')->begin()->isStatusCode(200)->checkElement('.search_results_content')->checkElement('#users_filters_family_name')->end()->click('.search_submit', array('users_filters' => array('family_name' => array('text' => 'Evil'))))->with('response')->begin()->isStatusCode(200)->checkElement('.results_container')->checkElement('.results_container .results > tbody > tr', 1)->end()->get('/user/choose')->click('Search', array('users_filters' => array('family_name' => array('text' => 'sdf'))))->with('response')->begin()->isStatusCode(200)->end();
$browser->test()->like($browser->getResponse()->getContent(), '/No Matching Items/', 'Content is ok');
$browser->info('Address')->get('/user/profile')->with('response')->begin()->isStatusCode(200)->checkElement('#address tbody tr', 0)->end()->click('#address a.link_catalogue')->with('response')->begin()->isStatusCode(200)->end()->click('Save')->with('response')->begin()->isStatusCode(200)->end()->with('form')->begin()->hasErrors(2)->isError('locality', 'required')->isError('country', 'required')->end()->click('Save', array('users_addresses' => array('locality' => 'Bruxelles', 'country' => 'Belgium', 'tag' => 'home,pref')))->with('response')->begin()->isStatusCode(200)->end();
$browser->test()->like($browser->getResponse()->getContent(), '/ok/', 'Content is ok');
$browser->get('/user/profile')->with('response')->begin()->isStatusCode(200)->checkElement('#address tbody tr', 1)->checkElement('#address tbody tr .tag', 2)->end()->click('#address table tbody a.link_catalogue')->with('response')->begin()->isStatusCode(200)->checkElement('input[value="Bruxelles"]')->end()->click('a.delete_button')->with('response')->begin()->isStatusCode(200)->end();
$browser->test()->like($browser->getResponse()->getContent(), '/ok/', 'Content is ok');
$browser->info('Comm')->get('/user/profile')->with('response')->begin()->isStatusCode(200)->checkElement('#comm tbody tr', 0)->end()->click('#comm a.link_catalogue')->with('response')->begin()->isStatusCode(200)->end()->click('Save')->with('response')->begin()->isStatusCode(200)->end()->with('form')->begin()->hasErrors(1)->isError('entry', 'required')->end()->click('Save', array('users_comm' => array('entry' => '+32478.254415', 'comm_type' => 'phone/fax', 'tag' => 'home')))->with('response')->begin()->isStatusCode(200)->end();
$browser->test()->like($browser->getResponse()->getContent(), '/ok/', 'Content is ok');
$browser->get('/user/profile')->with('response')->begin()->isStatusCode(200)->checkElement('#comm tbody tr', 1)->checkElement('#comm tbody tr .tag', 'Home')->end()->click('#comm table tbody a.link_catalogue')->with('response')->begin()->isStatusCode(200)->checkElement('input[value="+32478.254415"]')->end()->click('.delete_button')->with('response')->begin()->isStatusCode(200)->end();
$browser->test()->like($browser->getResponse()->getContent(), '/ok/', 'Content is ok');
$browser->get('/user/profile')->with('response')->begin()->isStatusCode(200)->end();
$browser->addCustomUserAndLogin('ychambert', 'toto');
$browser->addCustomUserAndLogin('encoder', 'evil');
$browser->addCustomUserAndLogin('manager', 'evil');
$browser->get('account/logout')->with('response')->begin()->isRedirected()->end()->followRedirect()->with('user')->begin()->isAuthenticated(false)->end()->login('ychambert', 'toto');
$browser->info('Search')->get('/user/index')->with('request')->begin()->isParameter('module', 'user')->isParameter('action', 'index')->end()->with('response')->begin()->isStatusCode(403)->end();
$browser->info('Widget')->get('/user/widget')->with('response')->begin()->isStatusCode(200)->checkElement('tbody[alt="board_widget"] tr', 5)->end()->click('#submit', array('user_widget' => array('MyWidgets' => array(0 => array('category' => 'board_widget', 'group_name' => 'savedSearch', 'user_ref' => $id, 'widget_choice' => 'opened', 'title_perso' => 'Search'), 1 => array('category' => 'board_widget', 'group_name' => 'savedSpecimens', 'user_ref' => $id, 'widget_choice' => 'opened', 'title_perso' => 'Spec')))))->with('request')->begin()->isParameter('module', 'user')->isParameter('action', 'widget')->end();
$browser->info('users ychambert is not allowed to access to this page')->get('user/loginInfo?user_ref=' . Doctrine::getTable("Users")->findOneByFamilyName('Evil')->getId())->with('response')->begin()->isStatusCode(403)->end()->info('Prerences')->get('user/preferences')->with('response')->begin()->isStatusCode()->checkElement('h1', '/My Preferences/')->checkElement('.user_table > thead', 3)->checkElement('.user_table > tbody', 3)->checkElement('.user_table > tbody > tr', 6)->checkElement('#preferences_board_spec_rec_pp option[selected]', '10')->checkElement('#preferences_board_search_rec_pp option[selected]', '10')->end()->click('input[type="submit"]', array('preferences' => array('board_spec_rec_pp' => 5, 'board_search_rec_pp' => 5)))->with('response')->begin()->isRedirected()->end()->followRedirect()->with('response')->begin()->isStatusCode()->checkElement('h1', '/My Preferences/')->checkElement('#preferences_board_spec_rec_pp option[selected]', '5')->checkElement('#preferences_board_search_rec_pp option[selected]', '5')->end();
$taxon = Doctrine::getTable('Taxonomy')->findOneByName('Falco Peregrinus Tunstall, 1771');
$taxonId = $taxon->getId();
$secondTaxon = Doctrine::getTable('Taxonomy')->findOneByName('Eucaryota');
$secondTaxonId = $secondTaxon->getId();
$collection = Doctrine::getTable('Collections')->findOneByName('Aves');
$collectionId = $collection->getId();
$collection->setCodePrefix('AVES');
$collection->setCodePrefixSeparator('/');
$collection->setCodeSuffix('LOULOU');
$collection->setCodeSuffixSeparator('-');
$collection->save();
$browser->info('1 - New Specimen screen')->get('/specimen/new')->with('request')->begin()->isParameter('module', 'specimen')->isParameter('action', 'new')->end()->info('1.1 - is everything ok on screen')->with('response')->begin()->isStatusCode(200)->checkElement('title', 'Add specimens')->checkElement('.board_col', 2)->checkElement('.board_col:first .widget', 11)->checkElement('.board_col:first .widget:first .widget_top_bar span', '/Collection/')->checkElement('.board_col:first .widget:nth-child(2) .widget_top_bar span', '/Codes/')->checkElement('.board_col:first .widget:nth-child(2) .widget_content thead tr', 4)->checkElement('.board_col:first .widget:nth-child(2) .widget_content thead tr:first th', 1)->checkElement('.board_col:first .widget:nth-child(2) .widget_content thead tr:first th', '/Mask:/')->checkElement('.board_col:first .widget:nth-child(2) .widget_content thead tr:nth-child(2) th', 1)->checkElement('.board_col:first .widget:nth-child(2) .widget_content thead tr:nth-child(3) th', 7)->checkElement('.board_col:first .widget:nth-child(2) .widget_content thead tr:nth-child(4) th', 5)->checkElement('.board_col:last .widget:first .widget_top_bar span', '/Acquisition/')->checkElement('.board_col:last .widget:nth-child(2) .widget_top_bar span', '/Expedition/')->checkElement('.board_col:last .widget:nth-child(3) .widget_top_bar span', '/I.G. number/')->checkElement('.board_col:last .widget:nth-child(4) .widget_top_bar span', '/Sampling location/')->checkElement('.board_col:last .widget:nth-child(5) .widget_top_bar span', '/Collectors/')->checkElement('.board_col:last .widget:nth-child(6) .widget_top_bar span', '/Properties/')->checkElement('.board_col:last .widget:nth-child(7) .widget_top_bar span', '/Comments/')->end();
$browser->info('2 - Specimen search')->get('/specimen/index')->with('request')->begin()->isParameter('module', 'specimen')->isParameter('action', 'index')->end()->info('2.1 - is everything ok on screen')->with('response')->begin()->isStatusCode(200)->checkElement('table.search tbody:first tr td:nth-child(2) input#searchSpecimen_taxon_name', 1)->checkElement('table.search tbody:last tr td:last input#searchSpecimen_caller_id', 1)->checkElement('table.search tbody:first tr td:last select#searchSpecimen_taxon_level_ref', 1)->checkElement('table.search tbody:first tr td:last select#searchSpecimen_taxon_level_ref option', 55)->end()->info('2.2 - Post waiting for the full results table and the pager')->post('/specimen/search', array('is_choose' => 0, 'searchSpecimen' => array()))->with('response')->begin()->isStatusCode()->checkElement('ul.pager_nav li', 10)->checkElement('ul.pager_nav li.page_selected', '[1]')->checkElement('.pager li a span.nav_arrow', 0)->checkElement('div.paging_info table td:nth-child(2)', 1)->checkElement('div.paging_info table td:last-child select[id="searchSpecimen_rec_per_page"]', 1)->checkElement('table.results tbody tr', 4)->checkElement('table.results tbody tr td:nth-child(1)', 'Amphibia')->checkElement('table.results thead th:nth-child(1) a.sort span.order_sign_down')->end()->info('2.3 - Click to sort on name descending...')->post('/specimen/search', array('orderby' => 'taxon_name', 'orderdir' => 'desc', 'page' => 1, 'is_choose' => 0, 'searchSpecimen' => array()))->with('response')->begin()->checkElement('table.results thead th:nth-child(3) a.sort span.order_sign_up')->end()->info('2.4 - Select only species level...')->post('/specimen/search', array('orderby' => 'taxon_name', 'orderdir' => 'asc', 'page' => 1, 'is_choose' => 0, 'searchSpecimen' => array('taxon_level_ref' => 48)))->with('response')->begin()->checkElement('table.results tbody tr', 1)->checkElement('table.results tbody tr td:nth-child(3)', 'Falco Peregrinus')->end()->info('2.5 - edition...');
$record = Doctrine::getTable('Specimens')->findOneByTaxonRef('2');
//Falco Peregrinus');
$browser->get('specimen/edit?id=' . $record->getId())->with('response')->begin()->isStatusCode(200)->checkElement('title', 'Edit Specimen')->checkElement('.board_col', 2)->end()->info('3 - Edit specimen - Change Taxon')->click('Save', array('specimen' => array('taxon_ref' => $taxonId, 'collection_ref' => $collectionId)))->with('response')->begin()->isRedirected()->end()->followRedirect()->with('response')->begin()->isStatusCode(200)->checkElement('.widget_content #specimen_collection_ref_name')->checkElement('.widget_content #specimen_taxon_ref_name')->end()->info('4 - Check sameTaxon action call')->info('4.1 - ...without arguments')->get('/specimen/sameTaxon')->with('response')->begin()->matches('/ok/')->end();
$specimens = Doctrine_Query::create()->from('Specimens')->orderBy('collection_ref ASC, taxon_ref ASC, id ASC')->execute();
$specId = $specimens[0]->getId();
$people_ref = Doctrine::getTable('People')->getPeopleByName('Root')->getId();
$browser->info('4.2 - ...with a specimen id and a taxon id different from one associated to specimen called')->get('specimen/sameTaxon', array('specId' => $specId, 'taxonId' => '-1'))->with('response')->begin()->matches('/not ok/')->end()->info('4.3 - ...with a specimen id and a corresponding taxon id')->get('specimen/sameTaxon', array('specId' => $specId, 'taxonId' => $specimens[0]->Taxonomy->getId()))->with('response')->begin()->matches('/ok/')->end()->info('4.4 - Check getTaxon action call without arguments')->get('specimen/getTaxon')->with('response')->begin()->isStatusCode(404)->end();
$num = 5;
$browser->info('5. - Check AddCode method call')->info('5.1 - First add...')->info('informations given are' . print_r(array('id' => $specId, 'num' => $num, 'collectionId' => $collectionId)))->get('specimen/addCode', array('id' => $specId, 'num' => $num, 'collectionId' => $collectionId))->with('response')->begin()->isStatusCode()->checkElement('tr td:first select#specimen_newCodes_' . $num . '_code_category', 1)->checkElement('tr td:nth-child(2) input#specimen_newCodes_' . $num . '_code_prefix', 1)->checkElement('tr td:nth-child(3) div#specimen_newCodes_' . $num . '_code_prefix_separator_parent', 1)->checkElement('tr td:nth-child(4) input#specimen_newCodes_' . $num . '_code', 1)->checkElement('tr td:nth-child(4) input[value="124"]', 1)->checkElement('tr td:nth-child(5) div#specimen_newCodes_' . $num . '_code_suffix_separator_parent', 1)->checkElement('tr td:nth-child(6) input#specimen_newCodes_' . $num . '_code_suffix', 1)->end();
$num += 1;
$browser->info('5.2 - Check AddCode auto-incrementation method call')->get('specimen/addCode', array('id' => $specId, 'num' => $num, 'collectionId' => $collectionId))->with('response')->begin()->isStatusCode()->checkElement('tr td:first select#specimen_newCodes_' . $num . '_code_category', 1)->checkElement('tr td:nth-child(2) input#specimen_newCodes_' . $num . '_code_prefix', 1)->checkElement('tr td:nth-child(3) div#specimen_newCodes_' . $num . '_code_prefix_separator_parent', 1)->checkElement('tr td:nth-child(4) input#specimen_newCodes_' . $num . '_code', 1)->checkElement('tr td:nth-child(4) input[value="125"]', 1)->checkElement('tr td:nth-child(5) div#specimen_newCodes_' . $num . '_code_suffix_separator_parent', 1)->checkElement('tr td:nth-child(6) input#specimen_newCodes_' . $num . '_code_suffix', 1)->end();
$num = 1;
$identifier_num = 1;
$browser->info('6 - Check AddIdentification method call')->get('specimen/addIdentification', array('spec_id' => $specId, 'num' => $num))->with('response')->begin()->isStatusCode()->checkElement('tr:first td:first[class="spec_ident_handle"]', 1)->checkElement('tr:first td:nth-child(3) select#specimen_newIdentification_' . $num . '_notion_concerned option', 11)->checkElement('tr:first td:nth-child(3) select#specimen_newIdentification_' . $num . '_notion_concerned option:first', 'All')->checkElement('tr:first td:last input:last[id="specimen_newIdentification_' . $num . '_order_by"][value="0"]', 1)->checkElement('tr:nth-child(2)[class="spec_ident_identifiers"]', 1)->checkElement('tr:nth-child(2)[class="spec_ident_identifiers"] td:nth-child(2) table#spec_ident_identifiers_' . $num, 1)->checkElement('tr:nth-child(2)[class="spec_ident_identifiers"] td:nth-child(2) table#spec_ident_identifiers_' . $num . ' tfoot div a[href="/index.php/specimen/addIdentifier/spec_id/' . $specId . '/num/' . $num . '/identifier_num/"]', 1)->end();
$browser->info('7 - Check AddIdentifier method call')->get('specimen/addIdentifier', array('spec_id' => $specId, 'people_ref' => $people_ref, 'num' => $num, 'identifier_num' => $identifier_num))->with('response')->begin()->isStatusCode()->checkElement('.spec_ident_identifiers_handle', 1)->end();
$browser->info('8 - add a property')->get('property/add/table/specimens/id/' . $specId)->with('response')->begin()->isStatusCode(200)->click('#submit', array('properties' => array('property_type' => 'length', 'applies_to' => 'ear size', 'lower_value' => '120', 'property_unit' => 'cm')))->end()->with('doctrine')->begin()->check('Properties', array('property_type' => 'length', 'applies_to' => 'ear size'))->end();
$browser->addCustomSpecimen();
$browser->with('response')->begin()->isRedirected()->followredirect()->end()->with('response')->begin()->isStatusCode()->checkElement('.board_col:first .widget:nth-child(2) tbody', 2)->checkElement('.board_col:first .widget:nth-child(5) .spec_ident_identifiers_handle', 2)->checkElement('table.collectors tr.spec_ident_collector_data', 2)->checkElement('#specimen_Comments_0_comment', 'Test comment for a collector')->click('Delete')->end();