Skip to content

Commit

Permalink
Refactoring tests
Browse files Browse the repository at this point in the history
  • Loading branch information
carusogabriel authored and jaapio committed Nov 29, 2017
1 parent b8169e8 commit 114abf4
Show file tree
Hide file tree
Showing 22 changed files with 37 additions and 37 deletions.
Expand Up @@ -169,7 +169,7 @@ public function testIfValueIsNullWhenANonExistingConfigPathIsGiven()
$result = $this->fixture->getOption($inputMock, $optionName, 'parser/defaultPackageName/notThere');

// Assert
$this->assertSame(null, $result);
$this->assertNull($result);
}

/**
Expand Down
Expand Up @@ -46,7 +46,7 @@ public function testSetAndGetTypes()
*/
public function testSetAndGetDefault()
{
$this->assertSame(null, $this->fixture->getDefault());
$this->assertNull($this->fixture->getDefault());

$this->fixture->setDefault('a');

Expand All @@ -59,11 +59,11 @@ public function testSetAndGetDefault()
*/
public function testSetAndGetWhetherArgumentIsPassedByReference()
{
$this->assertSame(false, $this->fixture->isByReference());
$this->assertFalse($this->fixture->isByReference());

$this->fixture->setByReference(true);

$this->assertSame(true, $this->fixture->isByReference());
$this->assertTrue($this->fixture->isByReference());
}

/**
Expand Down
Expand Up @@ -55,8 +55,8 @@ public function testCreateArgumentDescriptorFromReflector()
// Assert
$this->assertSame($name, $descriptor->getName());
$this->assertSame([$type], $descriptor->getTypes());
$this->assertSame(null, $descriptor->getDefault());
$this->assertSame(false, $descriptor->isByReference());
$this->assertNull($descriptor->getDefault());
$this->assertFalse($descriptor->isByReference());
}

/**
Expand All @@ -83,8 +83,8 @@ public function testIfTypeAndDescriptionAreSetFromParamDescriptor()
// Assert
$this->assertSame($name, $descriptor->getName());
$this->assertSame([$type], $descriptor->getTypes());
$this->assertSame(null, $descriptor->getDefault());
$this->assertSame(false, $descriptor->isByReference());
$this->assertNull($descriptor->getDefault());
$this->assertFalse($descriptor->isByReference());
}

/**
Expand Down
Expand Up @@ -87,9 +87,9 @@ public function testCreateMethodDescriptorFromReflector()
$this->assertSame($methodName, $descriptor->getName());
$this->assertSame('\\' . $namespace, $descriptor->getNamespace());
$this->assertSame('protected', (string)$descriptor->getVisibility());
$this->assertSame(false, $descriptor->isFinal());
$this->assertSame(false, $descriptor->isAbstract());
$this->assertSame(false, $descriptor->isStatic());
$this->assertFalse($descriptor->isFinal());
$this->assertFalse($descriptor->isAbstract());
$this->assertFalse($descriptor->isStatic());

$argument = $descriptor->getArguments()->get($argumentName);
$this->assertSame($argument->getName(), $argumentDescriptor->getName());
Expand Down
Expand Up @@ -40,7 +40,7 @@ protected function setUp()
*/
public function testSetAndGetParentClass()
{
$this->assertSame(null, $this->fixture->getParent());
$this->assertNull($this->fixture->getParent());

$parentMock = m::mock('phpDocumentor\Descriptor\ClassDescriptor');
$parentMock->shouldReceive('getFullyQualifiedStructuralElementName')->andReturn('TestClass');
Expand All @@ -65,7 +65,7 @@ public function testSettingAParentFailsWhenInputIsNotNullClassOrInterface()
*/
public function testSetAndGetParentInterface()
{
$this->assertSame(null, $this->fixture->getParent());
$this->assertNull($this->fixture->getParent());

$parentMock = m::mock('phpDocumentor\Descriptor\InterfaceDescriptor');
$parentMock->shouldReceive('getFullyQualifiedStructuralElementName')->andReturn('TestInterface');
Expand Down Expand Up @@ -129,7 +129,7 @@ public function testGetTypesUsingInheritanceOfVarTag()
*/
public function testSetAndGetValue()
{
$this->assertSame(null, $this->fixture->getValue());
$this->assertNull($this->fixture->getValue());

$this->fixture->setValue('a');

Expand Down
Expand Up @@ -117,7 +117,7 @@ public function testSettingAndGettingDescription()
public function testSettingAndGettingPackage()
{
$package = new PackageDescriptor();
$this->assertSame(null, $this->fixture->getPackage());
$this->assertNull($this->fixture->getPackage());

$this->fixture->setPackage($package);

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/phpDocumentor/Descriptor/FileDescriptorTest.php
Expand Up @@ -80,7 +80,7 @@ public function testSetAndGetPath()
*/
public function testSetAndGetSource()
{
$this->assertSame(null, $this->fixture->getSource());
$this->assertNull($this->fixture->getSource());

$this->fixture->setSource(self::EXAMPLE_SOURCE);

Expand Down
Expand Up @@ -50,7 +50,7 @@ public function testStripsIgnoreTagFromDescription()
$descriptor = m::mock('phpDocumentor\Descriptor\DescriptorAbstract');
$descriptor->shouldReceive('getTags->get')->with('ignore')->andReturn(true);

$this->assertSame(null, $this->fixture->filter($descriptor));
$this->assertNull($this->fixture->filter($descriptor));
}

/**
Expand All @@ -69,6 +69,6 @@ public function testDescriptorIsUnmodifiedIfThereIsNoIgnoreTag()
*/
public function testNullIsReturnedIfThereIsNoDescriptor()
{
$this->assertSame(null, $this->fixture->filter(null));
$this->assertNull($this->fixture->filter(null));
}
}
Expand Up @@ -52,7 +52,7 @@ public function testStripsTagFromDescriptionIfVisibilityIsNotAllowed()
$descriptor = m::mock('phpDocumentor\Descriptor\Interfaces\VisibilityInterface');
$descriptor->shouldReceive('getVisibility');

$this->assertSame(null, $this->fixture->filter($descriptor));
$this->assertNull($this->fixture->filter($descriptor));
}

/**
Expand Down
Expand Up @@ -36,7 +36,7 @@ public function testSetAndGetParent()
{
$parent = new NamespaceDescriptor();

$this->assertSame(null, $this->fixture->getParent());
$this->assertNull($this->fixture->getParent());

$this->fixture->setParent($parent);

Expand Down
Expand Up @@ -101,7 +101,7 @@ public function testSetAndGetTypesWhenVarIsPresent()
*/
public function testSetAndGetDefault()
{
$this->assertSame(null, $this->fixture->getDefault());
$this->assertNull($this->fixture->getDefault());

$this->fixture->setDefault('a');

Expand Down
Expand Up @@ -47,7 +47,7 @@ public function testRetrieveNameForBaseTypeWithTypeDescriptor()
*/
public function testRetrieveBaseTypeWithTypeStringReturnsNull()
{
$this->assertSame(null, $this->fixture->getBaseType());
$this->assertNull($this->fixture->getBaseType());
}

/**
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/phpDocumentor/Parser/Configuration/FilesTest.php
Expand Up @@ -68,14 +68,14 @@ public function testIfIgnoresCanBeRetrieved()
*/
public function testIfHiddenFilesShouldBeIgnored()
{
$this->assertSame(true, $this->fixture->isIgnoreHidden());
$this->assertTrue($this->fixture->isIgnoreHidden());
}

/**
* @covers phpDocumentor\Parser\Configuration\Files::isIgnoreSymlinks
*/
public function testIfSymlinksShouldBeIgnored()
{
$this->assertSame(true, $this->fixture->isIgnoreSymlinks());
$this->assertTrue($this->fixture->isIgnoreSymlinks());
}
}
6 changes: 3 additions & 3 deletions tests/unit/phpDocumentor/Partials/PartialTest.php
Expand Up @@ -33,7 +33,7 @@ protected function setUp()
*/
public function testGetContent()
{
$this->assertSame(null, $this->fixture->getContent());
$this->assertNull($this->fixture->getContent());
$this->fixture->setContent('Foo bar');

$result = $this->fixture->getContent();
Expand All @@ -47,7 +47,7 @@ public function testGetContent()
*/
public function testGetLink()
{
$this->assertSame(null, $this->fixture->getLink());
$this->assertNull($this->fixture->getLink());
$this->fixture->setLink('http://www.phpdoc.org/');

$result = $this->fixture->getLink();
Expand All @@ -61,7 +61,7 @@ public function testGetLink()
*/
public function testGetName()
{
$this->assertSame(null, $this->fixture->getName());
$this->assertNull($this->fixture->getName());
$this->fixture->setName('My name');

$result = $this->fixture->getName();
Expand Down
Expand Up @@ -39,7 +39,7 @@ protected function setUp()
*/
public function testAddingAParentEntry()
{
$this->assertSame(null, $this->object->getParent());
$this->assertNull($this->object->getParent());

$heading = new Heading();
$this->object->setParent($heading);
Expand Down
Expand Up @@ -37,7 +37,7 @@ protected function setUp()
public function testSetAndGetProject()
{
$project = m::mock('phpDocumentor\Descriptor\ProjectDescriptor');
$this->assertSame(null, $this->fixture->getProject());
$this->assertNull($this->fixture->getProject());

$this->fixture->setProject($project);

Expand Down
Expand Up @@ -38,7 +38,7 @@ protected function setUp()
*/
public function testSetAndGetSource()
{
$this->assertSame(null, $this->fixture->getSource());
$this->assertNull($this->fixture->getSource());

$this->fixture->setSource($this->source);

Expand Down
Expand Up @@ -41,7 +41,7 @@ protected function setUp()
*/
public function testSetAndGetElement()
{
$this->assertSame(null, $this->fixture->getElement());
$this->assertNull($this->fixture->getElement());

$this->fixture->setElement($this->element);

Expand Down
Expand Up @@ -126,7 +126,7 @@ public function testRenderWithUrlAndNoRuleMatch()
$this->renderer->setRouters($queue);
$result = $this->renderer->render('file://phpdoc', 'url');

$this->assertSame(null, $result);
$this->assertNull($result);
}

/**
Expand Down
Expand Up @@ -52,7 +52,7 @@ public function testFqsenDescriptorReturnsFalseWhenNodeOfWrongType()
$result = $fixture($fqsen);

// Assert
$this->assertSame(false, $result);
$this->assertFalse($result);
}

public function provideFqsens()
Expand Down
Expand Up @@ -33,7 +33,7 @@ protected function setUp()
*/
public function testSetAndGetKey()
{
$this->assertSame(null, $this->fixture->getKey());
$this->assertNull($this->fixture->getKey());

$this->fixture->setKey('key');

Expand All @@ -46,7 +46,7 @@ public function testSetAndGetKey()
*/
public function testSetAndGetValue()
{
$this->assertSame(null, $this->fixture->getValue());
$this->assertNull($this->fixture->getValue());

$this->fixture->setValue('value');

Expand Down
4 changes: 2 additions & 2 deletions tests/unit/phpDocumentor/Transformer/TransformationTest.php
Expand Up @@ -117,7 +117,7 @@ public function testGetParameterWithExistingName()
*/
public function testGetParameterWithNonExistingName()
{
$this->assertSame(null, $this->fixture->getParameter('somethingElse'));
$this->assertNull($this->fixture->getParameter('somethingElse'));
}

/**
Expand Down Expand Up @@ -145,7 +145,7 @@ public function testSetAndGetTransformer()
{
$transformer = m::mock('phpDocumentor\Transformer\Transformer');

$this->assertSame(null, $this->fixture->getTransformer());
$this->assertNull($this->fixture->getTransformer());

$this->fixture->setTransformer($transformer);

Expand Down

0 comments on commit 114abf4

Please sign in to comment.