public function setUp() { // don't forget to call parent so that request is set up correctly parent::setUp(); /** * @see http://docs.collectiveaccess.org/wiki/Web_Service_API#Creating_new_records * @see https://gist.githubusercontent.com/skeidel/3871797/raw/item_request.json */ $this->assertGreaterThan(0, $this->opn_object_id = $this->addTestRecord('ca_objects', array('intrinsic_fields' => array('type_id' => 'image', 'idno' => 'TEST & STUFF'), 'preferred_labels' => array(array("locale" => "en_US", "name" => "Sound & Motion")), 'nonpreferred_labels' => array(array("locale" => "en_US", "name" => "My test image")), 'attributes' => array('internal_notes' => array(array('internal_notes' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque ullamcorper sapien nec velit porta luctus.')), 'external_link' => array(array('url_source' => 'My URL source')), 'dimensions' => array(array('dimensions_length' => '10 in', 'dimensions_weight' => '2 lbs')), 'integer_test' => array(array('integer_test' => 23), array('integer_test' => 1984)), 'currency_test' => array(array('currency_test' => '$100')), 'georeference' => array(array('georeference' => '1600 Amphitheatre Parkway, Mountain View, CA')), 'coverageNotes' => array(array('coverageNotes' => '')))))); }
public function setUp() { // don't forget to call parent so that request is set up correctly parent::setUp(); /** * @see http://docs.collectiveaccess.org/wiki/Web_Service_API#Creating_new_records * @see https://gist.githubusercontent.com/skeidel/3871797/raw/item_request.json */ $this->assertGreaterThan(0, $vn_object_id = $this->addTestRecord('ca_objects', array('intrinsic_fields' => array('type_id' => 'image'), 'preferred_labels' => array(array("locale" => "en_US", "name" => "foo"))))); $this->opt_object = new ca_objects($vn_object_id); }
public function setUp() { // don't forget to call parent so that the request is set up parent::setUp(); /** * @see http://docs.collectiveaccess.org/wiki/Web_Service_API#Creating_new_records * @see https://gist.githubusercontent.com/skeidel/3871797/raw/item_request.json */ $vn_test_record = $this->addTestRecord('ca_objects', array('intrinsic_fields' => array('type_id' => 'image'), 'attributes' => array('internal_notes' => array(array('locale' => 'en_US', 'internal_notes' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque ullamcorper sapien nec velit porta luctus.'), array('locale' => 'de_DE', 'internal_notes' => 'Bacon ipsum dolor amet venison bresaola short ribs turkey ham hock beef ribs.')), 'external_link' => array(array('url_source' => 'My URL source'), array('url_source' => 'Another URL source')), 'dimensions' => array(array('dimensions_length' => '10 in', 'dimensions_weight' => '2 lbs', 'measurement_notes' => 'foo')), 'date' => array(array('dc_dates_types' => 'created', 'dates_value' => 'today')), 'integer_test' => array(array('integer_test' => 23), array('integer_test' => 1984)), 'currency_test' => array(array('currency_test' => '$100')), 'georeference' => array(array('georeference' => '1600 Amphitheatre Parkway, Mountain View, CA')), 'tgn' => array(array('tgn' => 'http://vocab.getty.edu/tgn/7015849')), 'wikipedia' => array(array('wikipedia' => 'http://en.wikipedia.org/wiki/Aaron_Burr')), 'informationservice' => array(array('wiki' => 'http://en.wikipedia.org/wiki/Aaron_Burr', 'ulan_container' => 'http://vocab.getty.edu/ulan/500024253'))))); $this->assertGreaterThan(0, $vn_test_record); $this->opt_object = new ca_objects($vn_test_record); }
public function setUp() { // don't forget to call parent so that the request is set up parent::setUp(); /** * @see http://docs.collectiveaccess.org/wiki/Web_Service_API#Creating_new_records * @see https://gist.githubusercontent.com/skeidel/3871797/raw/item_request.json */ $vn_test_record = $this->addTestRecord('ca_objects', array('intrinsic_fields' => array('type_id' => 'image'), 'attributes' => array('aat' => array(array('aat' => 'http://vocab.getty.edu/aat/300036794'))))); $this->assertGreaterThan(0, $vn_test_record); $this->opt_object = new ca_objects($vn_test_record); }
public function setUp() { // don't forget to call parent so that the request is set up parent::setUp(); for ($i = 0; $i < 50; $i++) { $vn_test_record = $this->addTestRecord('ca_objects', array('intrinsic_fields' => array('type_id' => 'image', 'idno' => $i))); $this->assertGreaterThan(0, $vn_test_record); } $vn_set_id = $this->addTestRecord('ca_sets', array('intrinsic_fields' => array('set_code' => 'batch_insert_delete_test', 'table_num' => 57, 'type_id' => 'user'))); $this->assertGreaterThan(0, $vn_set_id); $this->opt_set = new ca_sets($vn_set_id); }
public function setUp() { // don't forget to call parent so that the request is set up parent::setUp(); /** * @see http://docs.collectiveaccess.org/wiki/Web_Service_API#Creating_new_records * @see https://gist.githubusercontent.com/skeidel/3871797/raw/item_request.json */ $vn_test_record = $this->addTestRecord('ca_objects', array('intrinsic_fields' => array('type_id' => 'image'), 'attributes' => array('internal_notes' => array(array('locale' => 'en_US', 'internal_notes' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque ullamcorper sapien nec velit porta luctus.'), array('locale' => 'de_DE', 'internal_notes' => 'Bacon ipsum dolor amet venison bresaola short ribs turkey ham hock beef ribs.'))))); $this->assertGreaterThan(0, $vn_test_record); $this->opt_object = new ca_objects($vn_test_record); }
public function setUp() { // don't forget to call parent so that the request is set up parent::setUp(); /** * @see http://docs.collectiveaccess.org/wiki/Web_Service_API#Creating_new_records * @see https://gist.githubusercontent.com/skeidel/3871797/raw/item_request.json */ $vn_entity_id = $this->addTestRecord('ca_entities', array('intrinsic_fields' => array('type_id' => 'ind', 'idno' => 'hjs', 'lifespan' => '12/17/1989 -'), 'preferred_labels' => array(array("locale" => "en_US", "forename" => "Homer", "middlename" => "J.", "surname" => "Simpson")), 'nonpreferred_labels' => array(array("locale" => "en_US", "forename" => "Max", "middlename" => "", "surname" => "Power", "type_id" => "alt")))); $this->assertGreaterThan(0, $vn_entity_id); $vn_set_id = $this->addTestRecord('ca_sets', array('intrinsic_fields' => array('type_id' => 'user', 'set_code' => 'TEST'), 'preferred_labels' => array(array("locale" => "en_US", "name" => "Test set")), 'attributes' => array('entity_reference' => array(array('locale' => 'en_US', 'entity_reference' => $vn_entity_id))))); $this->assertGreaterThan(0, $vn_set_id); $this->opt_set = new ca_sets($vn_set_id); }
public function setUp() { // don't forget to call parent so that the request is set up parent::setUp(); /** * @see http://docs.collectiveaccess.org/wiki/Web_Service_API#Creating_new_records * @see https://gist.githubusercontent.com/skeidel/3871797/raw/item_request.json */ $vn_test_record = $this->addTestRecord('ca_objects', array('intrinsic_fields' => array('type_id' => 'moving_image'), 'preferred_labels' => array(array("locale" => "en_US", "name" => "My test moving image")), 'attributes' => array('duration' => array(array('duration' => '00:23:28'))))); $this->assertGreaterThan(0, $vn_test_record); $this->opt_object = new ca_objects($vn_test_record); $vn_comment_id = $this->opt_object->addComment("I like this very much.", 4); $this->setRecordMapEntry('ca_item_comments', $vn_comment_id); }
public function setUp() { // don't forget to call parent so that the request is set up parent::setUp(); /** * @see http://docs.collectiveaccess.org/wiki/Web_Service_API#Creating_new_records * @see https://gist.githubusercontent.com/skeidel/3871797/raw/item_request.json */ $i = 0; while ($i < 10) { $vn_test_record = $this->addTestRecord('ca_objects', array('intrinsic_fields' => array('type_id' => 'moving_image'), 'preferred_labels' => array(array("locale" => "en_US", "name" => "My test moving image {$i}")), 'attributes' => array('duration' => array(array('duration' => '00:23:28'))))); $this->assertGreaterThan(0, $vn_test_record); $i++; } }
public function setUp() { // don't forget to call parent so that the request is set up parent::setUp(); /** * @see http://docs.collectiveaccess.org/wiki/Web_Service_API#Creating_new_records * @see https://gist.githubusercontent.com/skeidel/3871797/raw/item_request.json */ $vn_homer_id = $this->addTestRecord('ca_entities', array('intrinsic_fields' => array('type_id' => 'ind', 'idno' => 'hjs'), 'preferred_labels' => array(array("locale" => "en_US", "forename" => "Homer", "middlename" => "J.", "surname" => "Simpson")))); $this->assertGreaterThan(0, $vn_homer_id); $vn_bart_id = $this->addTestRecord('ca_entities', array('intrinsic_fields' => array('type_id' => 'ind', 'idno' => 'bs'), 'preferred_labels' => array(array("locale" => "en_US", "forename" => "Bart", "surname" => "Simpson")), 'related' => array('ca_entities' => array(array('entity_id' => $vn_homer_id, 'type_id' => 'related', 'effective_date' => '2015', 'source_info' => 'Me'))))); $this->assertGreaterThan(0, $vn_bart_id); $this->opt_homer = new ca_entities($vn_homer_id); $this->opt_bart = new ca_entities($vn_bart_id); }
public function setUp() { // don't forget to call parent so that the request is set up parent::setUp(); /** * @see http://docs.collectiveaccess.org/wiki/Web_Service_API#Creating_new_records * @see https://gist.githubusercontent.com/skeidel/3871797/raw/item_request.json */ $vn_object_id = $this->addTestRecord('ca_objects', array('intrinsic_fields' => array('type_id' => 'image', 'idno' => 'test'))); $this->assertGreaterThan(0, $vn_object_id); $vn_loan_out = $this->addTestRecord('ca_storage_locations', array('intrinsic_fields' => array('type_id' => 'cabinet'), 'preferred_labels' => array(array("locale" => "en_US", "name" => "My Cabinet")), 'related' => array('ca_objects' => array(array('object_id' => $vn_object_id, 'type_id' => 'related', 'effective_date' => 'January 28 1985'))))); $this->assertGreaterThan(0, $vn_loan_out); $this->opt_object = new ca_objects($vn_object_id); $this->opt_location = new ca_storage_locations($vn_loan_out); }
public function setUp() { // don't forget to call parent so that the request is set up parent::setUp(); /** * @see http://docs.collectiveaccess.org/wiki/Web_Service_API#Creating_new_records * @see https://gist.githubusercontent.com/skeidel/3871797/raw/item_request.json */ $vn_loan_in = $this->addTestRecord('ca_loans', array('intrinsic_fields' => array('type_id' => 'in'), 'preferred_labels' => array(array("locale" => "en_US", "name" => "New Loan In")))); $this->assertGreaterThan(0, $vn_loan_in); $vn_loan_out = $this->addTestRecord('ca_loans', array('intrinsic_fields' => array('type_id' => 'out'), 'preferred_labels' => array(array("locale" => "en_US", "name" => "New Loan Out")), 'related' => array('ca_loans' => array(array('object_id' => $vn_loan_in, 'type_id' => 'related'))))); $this->assertGreaterThan(0, $vn_loan_out); $this->opt_loan_in = new ca_loans($vn_loan_in); $this->opt_loan_out = new ca_loans($vn_loan_out); }
public function setUp() { // don't forget to call parent so that the request is set up parent::setUp(); /** * @see http://docs.collectiveaccess.org/wiki/Web_Service_API#Creating_new_records * @see https://gist.githubusercontent.com/skeidel/3871797/raw/item_request.json */ $vn_object_id = $this->addTestRecord('ca_objects', array('intrinsic_fields' => array('type_id' => 'image'), 'preferred_labels' => array(array("locale" => "en_US", "name" => "My test image")))); $this->assertGreaterThan(0, $vn_object_id); $vn_entity_id = $this->addTestRecord('ca_entities', array('intrinsic_fields' => array('type_id' => 'ind', 'idno' => 'hjs'), 'preferred_labels' => array(array("locale" => "en_US", "forename" => "Homer", "middlename" => "J.", "surname" => "Simpson")), 'nonpreferred_labels' => array(array("locale" => "en_US", "forename" => "Max", "middlename" => "", "surname" => "Power", "type_id" => "alt")), 'related' => array('ca_objects' => array(array('object_id' => $vn_object_id, 'type_id' => 'creator', 'effective_date' => '2015', 'source_info' => 'Me'))))); $this->assertGreaterThan(0, $vn_entity_id); $vn_entity_id = $this->addTestRecord('ca_entities', array('intrinsic_fields' => array('type_id' => 'ind', 'idno' => 'bs'), 'preferred_labels' => array(array("locale" => "en_US", "forename" => "Bart", "middlename" => "", "surname" => "Simpson")), 'related' => array('ca_objects' => array(array('object_id' => $vn_object_id, 'type_id' => 'publisher', 'effective_date' => '2014-2015', 'source_info' => 'Homer'))))); $this->assertGreaterThan(0, $vn_entity_id); $vn_entity_id = $this->addTestRecord('ca_entities', array('intrinsic_fields' => array('type_id' => 'org', 'idno' => 'hjs'), 'preferred_labels' => array(array("locale" => "en_US", "forename" => "", "middlename" => "", "surname" => "ACME Inc.")), 'attributes' => array('internal_notes' => array(array('internal_notes' => 'Test notes'))), 'related' => array('ca_objects' => array(array('object_id' => $vn_object_id, 'type_id' => 'source', 'effective_date' => '2013', 'source_info' => 'Bart'))))); $this->assertGreaterThan(0, $vn_entity_id); $vn_related_object_id = $this->addTestRecord('ca_objects', array('intrinsic_fields' => array('type_id' => 'dataset'), 'preferred_labels' => array(array("locale" => "en_US", "name" => "My test dataset")), 'related' => array('ca_objects' => array(array('object_id' => $vn_object_id, 'type_id' => 'related'))))); $this->assertGreaterThan(0, $vn_related_object_id); $this->opt_object = new ca_objects($vn_object_id); }
public function setUp() { // don't forget to call parent so that the request is set up parent::setUp(); /** * @see http://docs.collectiveaccess.org/wiki/Web_Service_API#Creating_new_records * @see https://gist.githubusercontent.com/skeidel/3871797/raw/item_request.json */ $vn_object_id = $this->opn_object_id = $this->addTestRecord('ca_objects', array('intrinsic_fields' => array('type_id' => 'image', 'idno' => 'TEST.1'), 'preferred_labels' => array(array("locale" => "en_US", "name" => "My test image")), 'attributes' => array('internal_notes' => array(array('locale' => 'en_US', 'internal_notes' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque ullamcorper sapien nec velit porta luctus.')), 'description' => array(array('locale' => 'en_US', 'description' => 'First description'), array('locale' => 'en_US', 'description' => 'Second description'), array('locale' => 'en_US', 'description' => 'Third description')), 'external_link' => array(array('url_source' => 'My URL source'), array('url_source' => 'Another URL source')), 'dimensions' => array(array('dimensions_length' => '10 in', 'dimensions_weight' => '2 lbs', 'measurement_notes' => 'foo'), array('dimensions_length' => '5 in', 'dimensions_weight' => '3 lbs', 'measurement_notes' => 'meow'))))); $this->assertGreaterThan(0, $vn_object_id); $this->opt_object = new ca_objects($vn_object_id); $vn_rel_object_id = $this->opn_rel_object_id = $this->addTestRecord('ca_objects', array('intrinsic_fields' => array('type_id' => 'image', 'idno' => 'TEST.2'), 'preferred_labels' => array(array("locale" => "en_US", "name" => "Another image")), 'related' => array('ca_objects' => array(array('object_id' => $vn_object_id, 'type_id' => 'related'))), 'attributes' => array('dimensions' => array(array('dimensions_length' => '1 in', 'measurement_notes' => 'test'))))); $this->assertGreaterThan(0, $vn_rel_object_id); $vn_entity_id = $this->addTestRecord('ca_entities', array('intrinsic_fields' => array('type_id' => 'ind', 'idno' => 'hjs', 'lifespan' => '12/17/1989 -'), 'preferred_labels' => array(array("locale" => "en_US", "forename" => "Homer", "middlename" => "J.", "surname" => "Simpson")), 'nonpreferred_labels' => array(array("locale" => "en_US", "forename" => "Max", "middlename" => "", "surname" => "Power", "type_id" => "alt")), 'related' => array('ca_objects' => array(array('object_id' => $vn_object_id, 'type_id' => 'creator', 'effective_date' => '2015', 'source_info' => 'Me'))))); $this->assertGreaterThan(0, $vn_entity_id); $this->opn_entity_id1 = $vn_entity_id; $vn_entity_id = $this->addTestRecord('ca_entities', array('intrinsic_fields' => array('type_id' => 'ind', 'idno' => 'bs'), 'preferred_labels' => array(array("locale" => "en_US", "forename" => "Bart", "middlename" => "", "surname" => "Simpson")), 'related' => array('ca_objects' => array(array('object_id' => $vn_object_id, 'type_id' => 'publisher', 'effective_date' => '2014-2015', 'source_info' => 'Homer'))))); $this->assertGreaterThan(0, $vn_entity_id); $this->opn_entity_id2 = $vn_entity_id; }
public function tearDown() { // set parent id to null for both children to avoid FK conflicts during tearDown() if ($this->opt_child_object instanceof ca_objects) { $this->opt_child_object->setMode(ACCESS_WRITE); $this->opt_child_object->set('parent_id', null); $this->opt_child_object->update(); } if ($this->opt_another_child_object instanceof ca_objects) { $this->opt_another_child_object->setMode(ACCESS_WRITE); $this->opt_another_child_object->set('parent_id', null); $this->opt_another_child_object->update(); } parent::tearDown(); }