/**
  * @test
  */
 public function setFilter_TestFilters_ShouldFilterWeblinks()
 {
     $weblinkName_1 = 'Test Filter 1';
     $weblinkName_2 = 'Test Filter 2';
     $url = 'www.example.com';
     $this->weblinkManagerPage->addWeblink($weblinkName_1, $url, false);
     $message = $this->weblinkManagerPage->getAlertMessage();
     $this->assertTrue(strpos($message, 'Weblink successfully saved') >= 0, 'Weblink save should return success');
     $state = $this->weblinkManagerPage->getState($weblinkName_1);
     $this->assertEquals('published', $state, 'Initial state should be published');
     $this->weblinkManagerPage->addWeblink($weblinkName_2, $url, false);
     $message = $this->weblinkManagerPage->getAlertMessage();
     $this->assertTrue(strpos($message, 'Weblink successfully saved') >= 0, 'Weblink save should return success');
     $state = $this->weblinkManagerPage->getState($weblinkName_2);
     $this->assertEquals('published', $state, 'Initial state should be published');
     $this->weblinkManagerPage->changeWeblinkState($weblinkName_2, 'unpublished');
     $test = $this->weblinkManagerPage->setFilter('filter_state', 'Unpublished');
     $this->assertFalse($this->weblinkManagerPage->getRowNumber($weblinkName_1), 'Weblink should not show');
     $this->assertEquals(1, $this->weblinkManagerPage->getRowNumber($weblinkName_2), 'Weblink should be in row 1');
     $test = $this->weblinkManagerPage->setFilter('filter_state', 'Published');
     $this->assertFalse($this->weblinkManagerPage->getRowNumber($weblinkName_2), 'Weblink should not show');
     $this->assertEquals(10, $this->weblinkManagerPage->getRowNumber($weblinkName_1), 'Weblink should be in row 10');
     $this->weblinkManagerPage->setFilter('Select Status', 'Select Status');
     $this->weblinkManagerPage->trashAndDelete($weblinkName_1);
     $this->weblinkManagerPage->trashAndDelete($weblinkName_2);
 }
 /**
  * edit weblink and change the values of the field
  *
  * @return void
  *
  * 
  */
 public function editWeblink_ChangeFields_FieldsChanged()
 {
     $salt = rand();
     $weblinkName = 'Weblink' . $salt;
     $url = 'www.example.com';
     $this->assertFalse($this->weblinkManagerPage->getRowNumber($weblinkName), 'Test weblink should not be present');
     $this->weblinkManagerPage->addWeblink($weblinkName, $url, false);
     $this->weblinkManagerPage->editWeblink($weblinkName, array('Alt text' => 'Alternative Text' . $salt, 'Caption' => 'Sample Caption' . $salt, 'Image Float' => 'Right'));
     $values = $this->weblinkManagerPage->getFieldValues('WeblinkEditPage', $weblinkName, array('Alt text', 'Caption', 'Image Float'));
     $this->weblinkManagerPage->trashAndDelete($weblinkName);
 }