You are here

class RealisticDummyContentValueFieldTest in Realistic Dummy Content 8.2

Same name and namespace in other branches
  1. 7.2 api/src/test/includes/RealisticDummyContentValueFieldTest.php \Drupal\realistic_dummy_content_api\includes\RealisticDummyContentValueFieldTest

Tests for ...\includes\RealisticDummyContentValueField.

Hierarchy

Expanded class hierarchy of RealisticDummyContentValueFieldTest

File

api/src/test/includes/RealisticDummyContentValueFieldTest.php, line 42

Namespace

Drupal\realistic_dummy_content_api\includes
View source
class RealisticDummyContentValueFieldTest extends \PHPUnit_Framework_TestCase {

  /**
   * Test that empty files and non-existing files are treated differently.
   */
  public function testEmpty() {
    $field = new RealisticDummyContentValueField('ignore entity', 'ignore name');
    $null = new DummyFile(NULL);
    $empty = new DummyFile('');
    $this
      ->assertFalse(is_array($field
      ->implementValueFromFile($null)), 'No applicable field value is represented by NULL.');
    $this
      ->assertTrue(is_array($field
      ->implementValueFromFile($empty)), 'An empty string is considered a valid value.');
  }

}

Members

Namesort descending Modifiers Type Description Overrides
RealisticDummyContentValueFieldTest::testEmpty public function Test that empty files and non-existing files are treated differently.