/**
  * Test case teardown
  */
 public function tearDown()
 {
     eZURLWildcard::removeByIDs(array($this->wildcard->attribute('id')));
     eZURLWildcard::expireCache();
     clearstatcache();
     sleep(1);
     parent::tearDown();
 }
 /**
  * Tests eZURLWildcard constructor:
  * Checks that instanciated values are consistently read from the object
  */
 public function testConstructor()
 {
     $wildcard = new eZURLWildcard($this->wildcardRow[0]);
     $this->assertSame('test/*', $wildcard->attribute('source_url'), "Source URL doesn't match");
     $this->assertSame('/', $wildcard->attribute('destination_url'), "Destination URL doens't match");
     $this->assertEquals(eZURLWildcard::TYPE_DIRECT, $wildcard->attribute('type'), "Type doesn't match");
     $this->assertSame(null, $wildcard->attribute('id'), "ID should be NULL");
 }
Пример #3
0
 /**
  * Tests the storage operation of a new wildcard
  * Checks that submitted data and stored data are identical, and that a
  * numerical ID has been assigned
  **/
 public function testStore()
 {
     $row = array('source_url' => $sourceURL = 'testStore/*', 'destination_url' => $destinationURL = '/', 'type' => $type = eZURLWildcard::TYPE_DIRECT);
     $wildcard = new eZURLWildcard($row);
     $wildcard->store();
     $this->assertEquals($sourceURL, $wildcard->attribute('source_url'), "Source URL doesn't match");
     $this->assertEquals($destinationURL, $wildcard->attribute('destination_url'), "Destination URL doens't match");
     $this->assertEquals($type, $wildcard->attribute('type'), "Type doesn't match");
     $this->assertType('int', $wildcard->attribute('id'), "ID is not an integer");
 }