Skip to content

Commit

Permalink
Merge pull request #766 from gabriel-caruso/refactoring-tests
Browse files Browse the repository at this point in the history
Refactoring tests
  • Loading branch information
dbu committed Nov 30, 2017
2 parents b8f750a + ee67c68 commit 003e81e
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,6 @@ public function testFindOneBy()
$this->assertEquals($user1->username, $users1->username);

$users2 = $this->dm->getRepository('Doctrine\Tests\Models\CMS\CmsUser')->findOneBy(array('username' =>'obama'));
$this->assertEquals(null, $users2);
$this->assertNull($users2);
}
}
2 changes: 1 addition & 1 deletion tests/Doctrine/Tests/ODM/PHPCR/Functional/PropertyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public function testPropertyname()
$this->assertNotNull($doc->date);
$this->assertEquals($date->getTimestamp(), $doc->date->getTimestamp());
$this->assertNotNull($doc->boolean);
$this->assertEquals(true, $doc->boolean);
$this->assertTrue($doc->boolean);
$this->assertNotNull($doc->name);
$this->assertEquals('aname', $doc->name);
$this->assertNotNull($doc->path);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,12 +216,12 @@ public function testLoadTranslationWithNullable()
$strategy = new ChildTranslationStrategy($this->dm);
$this->assertTrue($strategy->loadTranslation($doc, $node, $this->metadata, 'fr'), 'Should succeed to load FR translation');

$this->assertEquals(null, $doc->nullable);
$this->assertNull($doc->nullable);

$strategy = new ChildTranslationStrategy($this->dm);
$this->assertTrue($strategy->loadTranslation($doc, $node, $this->metadata, 'de'), 'Should succeed to load DE translation');

$this->assertEquals(null, $doc->nullable);
$this->assertNull($doc->nullable);
}

public function testLoadTranslationMissing()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function testLoadAnnotations()
// Check the annotation is not set if it is not present
$metadata = $factory->getMetadataFor('Doctrine\Tests\Models\Versioning\NonVersionableArticle');
$this->assertTrue(isset($metadata->versionable));
$this->assertEquals(false, $metadata->versionable);
$this->assertFalse($metadata->versionable);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function testGetTypeOfField()
{
$cmi = new ClassMetadata('Doctrine\Tests\ODM\PHPCR\Mapping\Person');
$cmi->initializeReflection(new RuntimeReflectionService());
$this->assertEquals(null, $cmi->getTypeOfField('some_field'));
$this->assertNull($cmi->getTypeOfField('some_field'));
$cmi->mappings['some_field'] = array('type' => 'some_type');
$this->assertEquals('some_type', $cmi->getTypeOfField('some_field'));
}
Expand Down

0 comments on commit 003e81e

Please sign in to comment.