function fieldCase::verifyInstance

8.0.x fieldTest.php fieldCase::verifyInstance($name, $options, $expected = TRUE)
6.x fieldTest.php fieldCase::verifyInstance($name, $options, $expected = TRUE)
7.x fieldTest.php fieldCase::verifyInstance($name, $options, $expected = TRUE)
4.x fieldTest.php fieldCase::verifyInstance($name, $options, $expected = TRUE)
5.x fieldTest.php fieldCase::verifyInstance($name, $options, $expected = TRUE)
1 call to fieldCase::verifyInstance()

File

tests/fieldTest.php, line 41

Class

fieldCase

Code

function verifyInstance($name, $options, $expected = TRUE) {
  $this->drush('field-info', array('fields'), $options + array('pipe' => NULL));
  $output = $this->getOutputAsList();
  $found = FALSE;
  foreach ($output as $row) {
    $columns = explode(',', $row);
    if ($columns[0] == $name) {
      $this->assertEquals('text', $columns[1], $name . ' field is of type=text.');
      $this->assertEquals('user', $columns[2], $name . ' field was added to user bundle.');
      $found = TRUE;
      break;
    }
  }
  if ($expected) {
    $this->assertTrue($found, $name . ' field was created.');
  }
  else {
    $this->assertFalse($found, $name . ' field was not present.');
  }
}