tests: add strict_types and typehints, remove tests that are now covered by typehints

This commit is contained in:
TomasVotruba
2017-11-30 10:27:01 +01:00
committed by Jaap van Otterdijk
parent d874c4d14a
commit a1d8751ad6
32 changed files with 66 additions and 81 deletions
@@ -1,4 +1,5 @@
<?php <?php declare(strict_types=1);
/** /**
* This file is part of phpDocumentor. * This file is part of phpDocumentor.
* *
@@ -1,4 +1,5 @@
<?php <?php declare(strict_types=1);
/** /**
* This file is part of phpDocumentor. * This file is part of phpDocumentor.
* *
@@ -1,4 +1,5 @@
<?php <?php declare(strict_types=1);
/** /**
* This file is part of phpDocumentor. * This file is part of phpDocumentor.
* *
+2 -1
View File
@@ -1,4 +1,5 @@
<?php <?php declare(strict_types=1);
/** /**
* This file is part of phpDocumentor. * This file is part of phpDocumentor.
* *
@@ -1,4 +1,5 @@
<?php <?php declare(strict_types=1);
/** /**
* This file is part of phpDocumentor. * This file is part of phpDocumentor.
* *
+2 -10
View File
@@ -1,4 +1,5 @@
<?php <?php declare(strict_types=1);
/** /**
* This file is part of phpDocumentor. * This file is part of phpDocumentor.
* *
@@ -124,13 +125,4 @@ class DescriptionTest extends TestCase
$expected = '@JoinTable(name="table", joinColumns={@JoinColumn (name="column_id", referencedColumnName="id")}, inverseJoinColumns={@JoinColumn (name="column_id_2", referencedColumnName="id")})'; $expected = '@JoinTable(name="table", joinColumns={@JoinColumn (name="column_id", referencedColumnName="id")}, inverseJoinColumns={@JoinColumn (name="column_id_2", referencedColumnName="id")})';
$this->assertSame($expected, (string)$fixture); $this->assertSame($expected, (string)$fixture);
} }
/**
* @covers ::__construct
* @expectedException \InvalidArgumentException
*/
public function testBodyTemplateMustBeAString()
{
new Description([]);
}
} }
+1 -1
View File
@@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
namespace phpDocumentor\Reflection\DocBlock; namespace phpDocumentor\Reflection\DocBlock;
+2 -37
View File
@@ -1,4 +1,5 @@
<?php <?php declare(strict_types=1);
/** /**
* This file is part of phpDocumentor. * This file is part of phpDocumentor.
* *
@@ -198,40 +199,4 @@ DOCCOMMENT_AFTER_REMOVE;
$docBlock->removeTag($genericTag); $docBlock->removeTag($genericTag);
$this->assertSame($expectedAfterRemove, $fixture->getDocComment($docBlock)); $this->assertSame($expectedAfterRemove, $fixture->getDocComment($docBlock));
} }
/**
* @covers ::__construct
* @expectedException \InvalidArgumentException
*/
public function testInitializationFailsIfIndentIsNotAnInteger()
{
new Serializer([]);
}
/**
* @covers ::__construct
* @expectedException \InvalidArgumentException
*/
public function testInitializationFailsIfIndentStringIsNotAString()
{
new Serializer(0, []);
}
/**
* @covers ::__construct
* @expectedException \InvalidArgumentException
*/
public function testInitializationFailsIfIndentFirstLineIsNotABoolean()
{
new Serializer(0, '', []);
}
/**
* @covers ::__construct
* @expectedException \InvalidArgumentException
*/
public function testInitializationFailsIfLineLengthIsNotNullNorAnInteger()
{
new Serializer(0, '', false, []);
}
} }
@@ -1,4 +1,5 @@
<?php <?php declare(strict_types=1);
/** /**
* This file is part of phpDocumentor. * This file is part of phpDocumentor.
* *
+2 -1
View File
@@ -1,4 +1,5 @@
<?php <?php declare(strict_types=1);
/** /**
* This file is part of phpDocumentor. * This file is part of phpDocumentor.
* *
+2 -1
View File
@@ -1,4 +1,5 @@
<?php <?php declare(strict_types=1);
/** /**
* This file is part of phpDocumentor. * This file is part of phpDocumentor.
* *
+2 -1
View File
@@ -1,4 +1,5 @@
<?php <?php declare(strict_types=1);
/** /**
* This file is part of phpDocumentor. * This file is part of phpDocumentor.
* *
+1 -1
View File
@@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
namespace DocBlock\Tags; namespace DocBlock\Tags;
@@ -1,4 +1,5 @@
<?php <?php declare(strict_types=1);
/** /**
* This file is part of phpDocumentor. * This file is part of phpDocumentor.
* *
@@ -1,4 +1,5 @@
<?php <?php declare(strict_types=1);
/** /**
* This file is part of phpDocumentor. * This file is part of phpDocumentor.
* *
+2 -1
View File
@@ -1,4 +1,5 @@
<?php <?php declare(strict_types=1);
/** /**
* This file is part of phpDocumentor. * This file is part of phpDocumentor.
* *
+2 -1
View File
@@ -1,4 +1,5 @@
<?php <?php declare(strict_types=1);
/** /**
* This file is part of phpDocumentor. * This file is part of phpDocumentor.
* *
+6 -5
View File
@@ -1,4 +1,5 @@
<?php <?php declare(strict_types=1);
/** /**
* This file is part of phpDocumentor. * This file is part of phpDocumentor.
* *
@@ -347,10 +348,10 @@ class MethodTest extends TestCase
* @param string null $expectedKeyType * @param string null $expectedKeyType
*/ */
public function testCollectionReturnTypes( public function testCollectionReturnTypes(
$returnType, string $returnType,
$expectedType, string $expectedType,
$expectedValueType = null, string $expectedValueType = null,
$expectedKeyType = null string $expectedKeyType = null
) { ) {
$resolver = new TypeResolver(); $resolver = new TypeResolver();
$descriptionFactory = m::mock(DescriptionFactory::class); $descriptionFactory = m::mock(DescriptionFactory::class);
+2 -1
View File
@@ -1,4 +1,5 @@
<?php <?php declare(strict_types=1);
/** /**
* This file is part of phpDocumentor. * This file is part of phpDocumentor.
* *
@@ -1,4 +1,5 @@
<?php <?php declare(strict_types=1);
/** /**
* This file is part of phpDocumentor. * This file is part of phpDocumentor.
* *
+2 -1
View File
@@ -1,4 +1,5 @@
<?php <?php declare(strict_types=1);
/** /**
* This file is part of phpDocumentor. * This file is part of phpDocumentor.
* *
@@ -1,4 +1,5 @@
<?php <?php declare(strict_types=1);
/** /**
* This file is part of phpDocumentor. * This file is part of phpDocumentor.
* *
+2 -1
View File
@@ -1,4 +1,5 @@
<?php <?php declare(strict_types=1);
/** /**
* This file is part of phpDocumentor. * This file is part of phpDocumentor.
* *
+2 -1
View File
@@ -1,4 +1,5 @@
<?php <?php declare(strict_types=1);
/** /**
* This file is part of phpDocumentor. * This file is part of phpDocumentor.
* *
+2 -1
View File
@@ -1,4 +1,5 @@
<?php <?php declare(strict_types=1);
/** /**
* This file is part of phpDocumentor. * This file is part of phpDocumentor.
* *
+2 -1
View File
@@ -1,4 +1,5 @@
<?php <?php declare(strict_types=1);
/** /**
* This file is part of phpDocumentor. * This file is part of phpDocumentor.
* *
+2 -1
View File
@@ -1,4 +1,5 @@
<?php <?php declare(strict_types=1);
/** /**
* This file is part of phpDocumentor. * This file is part of phpDocumentor.
* *
+2 -1
View File
@@ -1,4 +1,5 @@
<?php <?php declare(strict_types=1);
/** /**
* This file is part of phpDocumentor. * This file is part of phpDocumentor.
* *
+2 -1
View File
@@ -1,4 +1,5 @@
<?php <?php declare(strict_types=1);
/** /**
* This file is part of phpDocumentor. * This file is part of phpDocumentor.
* *
+2 -1
View File
@@ -1,4 +1,5 @@
<?php <?php declare(strict_types=1);
/** /**
* This file is part of phpDocumentor. * This file is part of phpDocumentor.
* *
+2 -1
View File
@@ -1,4 +1,5 @@
<?php <?php declare(strict_types=1);
/** /**
* This file is part of phpDocumentor. * This file is part of phpDocumentor.
* *
+2 -1
View File
@@ -1,4 +1,5 @@
<?php <?php declare(strict_types=1);
/** /**
* This file is part of phpDocumentor. * This file is part of phpDocumentor.
* *