TripalEntityCollection.test 912 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. use PHPUnit\Framework\TestCase;
  3. class TripalEntityCollectionTest extends TestCase {
  4. protected $collection = NULL;
  5. public function setUp() {
  6. $details = ['uid' => 1, 'collection_name' => "test_collection_name"];
  7. $collection = new TripalEntityCollection();
  8. $collection->create($details);
  9. $this->collection = $collection;
  10. }
  11. public function testCreateCollectionAndBaseGetters() {
  12. $collection = $this->collection;
  13. $name = $collection->getName();
  14. $collection_id = $collection->getCollectionID();
  15. $this->assertEquals($name, "test_collection_name");
  16. $this->assertNotNull($collection_id);
  17. $this->assertInternalType("int", (int) $collection_id);
  18. }
  19. public function testAddBundle() {
  20. //create two entities, AND their fields. annoying.
  21. $details = ['bundle_name' => 'organism'];
  22. }
  23. public function tearDown() {
  24. $this->collection->delete();
  25. }
  26. }