Skip to content

Commit

Permalink
Issue #3128575 by longwave, jungle, daffie: Replace assert*(*, is_nul…
Browse files Browse the repository at this point in the history
…l()) with assertNotNull()/assertNull()

(cherry picked from commit bcec845d85bfdc6ce234e1704090f079670b4ee6)
  • Loading branch information
catch committed Apr 27, 2020
1 parent 67e04b6 commit 5a07412
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ protected function setUp() {
public function testWidgetSettings() {
// Test the config can be loaded.
$form_display = EntityFormDisplay::load('node.story.default');
$this->assertIdentical(FALSE, is_null($form_display), "Form display node.story.default loaded with config.");
$this->assertNotNull($form_display);

// Text field.
$component = $form_display->getComponent('field_test');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ protected function assertComponent($display_id, $component_id, $type, $label, $w
*/
protected function assertComponentNotExists($display_id, $component_id) {
$component = EntityViewDisplay::load($display_id)->getComponent($component_id);
$this->assertTrue(is_null($component));
$this->assertNull($component);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function testUploadEntityDisplay() {
// Assure this doesn't exist.
$display = EntityViewDisplay::load('node.article.default');
$component = $display->getComponent('upload');
$this->assertTrue(is_null($component));
$this->assertNull($component);

$this->assertIdentical([['node', 'page', 'default', 'upload']], $this->getMigration('d6_upload_entity_display')->getIdMap()->lookupDestinationIds(['page']));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function testUploadEntityFormDisplay() {
// Assure this doesn't exist.
$display = EntityFormDisplay::load('node.article.default');
$component = $display->getComponent('upload');
$this->assertTrue(is_null($component));
$this->assertNull($component);

$this->assertIdentical([['node', 'page', 'default', 'upload']], $this->getMigration('d6_upload_entity_form_display')->getIdMap()->lookupDestinationIds(['page']));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function testUploadFieldInstance() {

// Shouldn't exist.
$field = FieldConfig::load('node.article.upload');
$this->assertTrue(is_null($field));
$this->assertNull($field);

$this->assertIdentical([['node', 'page', 'upload']], $this->getMigration('d6_upload_field_instance')->getIdMap()->lookupDestinationIds(['page']));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function testValidation($input, $exception) {
$this->expectExceptionMessage($exception->getMessage());
}
EntityCondition::createFromQueryParameter($input);
$this->assertTrue(is_null($exception), 'No exception was expected.');
$this->assertNull($exception, 'No exception was expected.');
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ protected function setUp() {
public function testViewModes() {
// Test a new view mode.
$view_mode = EntityViewMode::load('node.preview');
$this->assertIdentical(FALSE, is_null($view_mode), 'Preview view mode loaded.');
$this->assertNotNull($view_mode);
$this->assertIdentical('Preview', $view_mode->label(), 'View mode has correct label.');
// Test the ID map.
$this->assertIdentical([['node', 'preview']], $this->getMigration('d6_view_modes')->getIdMap()->lookupDestinationIds([1]));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ protected function setUp() {
*/
public function testUserProfileValues() {
$user = User::load(2);
$this->assertFalse(is_null($user));
$this->assertNotNull($user);
$this->assertIdentical('red', $user->profile_color->value);
$expected = <<<EOT
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam nulla sapien, congue nec risus ut, adipiscing aliquet felis. Maecenas quis justo vel nulla varius euismod. Quisque metus metus, cursus sit amet sem non, bibendum vehicula elit. Cras dui nisl, eleifend at iaculis vitae, lacinia ut felis. Nullam aliquam ligula volutpat nulla consectetur accumsan. Maecenas tincidunt molestie diam, a accumsan enim fringilla sit amet. Morbi a tincidunt tellus. Donec imperdiet scelerisque porta. Sed quis sem bibendum eros congue sodales. Vivamus vel fermentum est, at rutrum orci. Nunc consectetur purus ut dolor pulvinar, ut volutpat felis congue. Cras tincidunt odio sed neque sollicitudin, vehicula tempor metus scelerisque.
Expand Down

0 comments on commit 5a07412

Please sign in to comment.