Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/unit/PseudoTypes/ArrayShapeItemTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

use PHPUnit\Framework\TestCase;

class ArrayShapeItemTest extends TestCase
final class ArrayShapeItemTest extends TestCase
{
public function testCreate(): void
{
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/PseudoTypes/ArrayShapeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use phpDocumentor\Reflection\Types\Mixed_;
use PHPUnit\Framework\TestCase;

class ArrayShapeTest extends TestCase
final class ArrayShapeTest extends TestCase
{
public function testCreate(): void
{
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/PseudoTypes/CallableStringTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use phpDocumentor\Reflection\Types\String_;
use PHPUnit\Framework\TestCase;

class CallableStringTest extends TestCase
final class CallableStringTest extends TestCase
{
public function testCreate(): void
{
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/PseudoTypes/ClassStringTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
use phpDocumentor\Reflection\Types\String_;
use PHPUnit\Framework\TestCase;

class ClassStringTest extends TestCase
final class ClassStringTest extends TestCase
{
public function testCreate(): void
{
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/PseudoTypes/ConditionalForParameterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use phpDocumentor\Reflection\Types\Static_;
use PHPUnit\Framework\TestCase;

class ConditionalForParameterTest extends TestCase
final class ConditionalForParameterTest extends TestCase
{
public function testCreate(): void
{
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/PseudoTypes/ConditionalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use phpDocumentor\Reflection\Types\Static_;
use PHPUnit\Framework\TestCase;

class ConditionalTest extends TestCase
final class ConditionalTest extends TestCase
{
public function testCreate(): void
{
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/PseudoTypes/ConstExpressionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
use phpDocumentor\Reflection\Types\Object_;
use PHPUnit\Framework\TestCase;

class ConstExpressionTest extends TestCase
final class ConstExpressionTest extends TestCase
{
public function testCreate(): void
{
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/PseudoTypes/EnumStringTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
use phpDocumentor\Reflection\Types\String_;
use PHPUnit\Framework\TestCase;

class EnumStringTest extends TestCase
final class EnumStringTest extends TestCase
{
public function testCreate(): void
{
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/PseudoTypes/FloatValueTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use phpDocumentor\Reflection\Types\Float_;
use PHPUnit\Framework\TestCase;

class FloatValueTest extends TestCase
final class FloatValueTest extends TestCase
{
public function testCreate(): void
{
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/PseudoTypes/GenericTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use phpDocumentor\Reflection\Types\String_;
use PHPUnit\Framework\TestCase;

class GenericTest extends TestCase
final class GenericTest extends TestCase
{
public function testCreate(): void
{
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/PseudoTypes/HtmlEscapedStringTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use phpDocumentor\Reflection\Types\String_;
use PHPUnit\Framework\TestCase;

class HtmlEscapedStringTest extends TestCase
final class HtmlEscapedStringTest extends TestCase
{
public function testCreate(): void
{
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/PseudoTypes/IntMaskOfTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use phpDocumentor\Reflection\Types\Integer;
use PHPUnit\Framework\TestCase;

class IntMaskOfTest extends TestCase
final class IntMaskOfTest extends TestCase
{
public function testCreate(): void
{
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/PseudoTypes/IntMaskTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use phpDocumentor\Reflection\Types\Integer;
use PHPUnit\Framework\TestCase;

class IntMaskTest extends TestCase
final class IntMaskTest extends TestCase
{
public function testCreate(): void
{
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/PseudoTypes/IntegerRangeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use phpDocumentor\Reflection\Types\Integer;
use PHPUnit\Framework\TestCase;

class IntegerRangeTest extends TestCase
final class IntegerRangeTest extends TestCase
{
public function testCreate(): void
{
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/PseudoTypes/IntegerValueTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use phpDocumentor\Reflection\Types\Integer;
use PHPUnit\Framework\TestCase;

class IntegerValueTest extends TestCase
final class IntegerValueTest extends TestCase
{
public function testCreate(): void
{
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/PseudoTypes/InterfaceStringTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
use phpDocumentor\Reflection\Types\String_;
use PHPUnit\Framework\TestCase;

class InterfaceStringTest extends TestCase
final class InterfaceStringTest extends TestCase
{
public function testCreate(): void
{
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/PseudoTypes/KeyOfTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use phpDocumentor\Reflection\Types\Object_;
use PHPUnit\Framework\TestCase;

class KeyOfTest extends TestCase
final class KeyOfTest extends TestCase
{
public function testCreate(): void
{
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/PseudoTypes/ListShapeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

use PHPUnit\Framework\TestCase;

class ListShapeTest extends TestCase
final class ListShapeTest extends TestCase
{
public function testToString(): void
{
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/PseudoTypes/ListTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
use phpDocumentor\Reflection\Types\String_;
use PHPUnit\Framework\TestCase;

class ListTest extends TestCase
final class ListTest extends TestCase
{
public function testCreateWithoutParams(): void
{
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/PseudoTypes/LiteralStringTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use phpDocumentor\Reflection\Types\String_;
use PHPUnit\Framework\TestCase;

class LiteralStringTest extends TestCase
final class LiteralStringTest extends TestCase
{
public function testCreate(): void
{
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/PseudoTypes/LowercaseStringTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use phpDocumentor\Reflection\Types\String_;
use PHPUnit\Framework\TestCase;

class LowercaseStringTest extends TestCase
final class LowercaseStringTest extends TestCase
{
public function testCreate(): void
{
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/PseudoTypes/NegativeIntegerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use phpDocumentor\Reflection\Types\Integer;
use PHPUnit\Framework\TestCase;

class NegativeIntegerTest extends TestCase
final class NegativeIntegerTest extends TestCase
{
public function testCreate(): void
{
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/PseudoTypes/NonEmptyArrayTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
use phpDocumentor\Reflection\Types\String_;
use PHPUnit\Framework\TestCase;

class NonEmptyArrayTest extends TestCase
final class NonEmptyArrayTest extends TestCase
{
public function testCreateWithoutParams(): void
{
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/PseudoTypes/NonEmptyListTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
use phpDocumentor\Reflection\Types\String_;
use PHPUnit\Framework\TestCase;

class NonEmptyListTest extends TestCase
final class NonEmptyListTest extends TestCase
{
public function testCreateWithoutParams(): void
{
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/PseudoTypes/NonEmptyLowercaseStringTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use phpDocumentor\Reflection\Types\String_;
use PHPUnit\Framework\TestCase;

class NonEmptyLowercaseStringTest extends TestCase
final class NonEmptyLowercaseStringTest extends TestCase
{
public function testCreate(): void
{
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/PseudoTypes/NonEmptyStringTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use phpDocumentor\Reflection\Types\String_;
use PHPUnit\Framework\TestCase;

class NonEmptyStringTest extends TestCase
final class NonEmptyStringTest extends TestCase
{
public function testCreate(): void
{
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/PseudoTypes/NumericStringTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use phpDocumentor\Reflection\Types\String_;
use PHPUnit\Framework\TestCase;

class NumericStringTest extends TestCase
final class NumericStringTest extends TestCase
{
public function testCreate(): void
{
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/PseudoTypes/ObjectShapeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use phpDocumentor\Reflection\Types\Object_;
use PHPUnit\Framework\TestCase;

class ObjectShapeTest extends TestCase
final class ObjectShapeTest extends TestCase
{
public function testCreate(): void
{
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/PseudoTypes/OffsetAccessTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use phpDocumentor\Reflection\Types\Object_;
use PHPUnit\Framework\TestCase;

class OffsetAccessTest extends TestCase
final class OffsetAccessTest extends TestCase
{
public function testCreate(): void
{
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/PseudoTypes/PositiveIntegerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use phpDocumentor\Reflection\Types\Integer;
use PHPUnit\Framework\TestCase;

class PositiveIntegerTest extends TestCase
final class PositiveIntegerTest extends TestCase
{
public function testCreate(): void
{
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/PseudoTypes/StringValueTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use phpDocumentor\Reflection\Types\String_;
use PHPUnit\Framework\TestCase;

class StringValueTest extends TestCase
final class StringValueTest extends TestCase
{
public function testCreate(): void
{
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/PseudoTypes/TraitStringTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
use phpDocumentor\Reflection\Types\String_;
use PHPUnit\Framework\TestCase;

class TraitStringTest extends TestCase
final class TraitStringTest extends TestCase
{
public function testCreate(): void
{
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/PseudoTypes/TrueTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use phpDocumentor\Reflection\Types\Boolean;
use PHPUnit\Framework\TestCase;

class TrueTest extends TestCase
final class TrueTest extends TestCase
{
public function testExposesUnderlyingType(): void
{
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/PseudoTypes/ValueOfTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use phpDocumentor\Reflection\Types\Object_;
use PHPUnit\Framework\TestCase;

class ValueOfTest extends TestCase
final class ValueOfTest extends TestCase
{
public function testCreate(): void
{
Expand Down
9 changes: 9 additions & 0 deletions tests/unit/TypeResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ public function testResolvingKeywords(string $keyword, string $expectedClass): v
$fixture = new TypeResolver();

$resolvedType = $fixture->resolve($keyword, new Context(''));
$this->assertInstanceOf($expectedClass, $resolvedType);

$resolvedType = $fixture->resolve($keyword);
$this->assertInstanceOf($expectedClass, $resolvedType);
}

Expand Down Expand Up @@ -1339,4 +1341,11 @@ public function illegalLegacyFormatProvider(): array
],
];
}

public function testCreateTypeFromNull(): void
{
$fixture = new TypeResolver();

$this->assertEquals(new Mixed_(), $fixture->createType(null, new Context('')));
}
}
10 changes: 5 additions & 5 deletions tests/unit/Types/ArrayTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use phpDocumentor\Reflection\Fqsen;
use PHPUnit\Framework\TestCase;

class ArrayTest extends TestCase
final class ArrayTest extends TestCase
{
public function testCreateWithoutParams(): void
{
Expand Down Expand Up @@ -47,17 +47,17 @@ public function testCreateWithParams(): void
}

/**
* @dataProvider provideArrays
* @dataProvider provideToStringData
*/
public function testArrayStringifyCorrectly(Array_ $array, string $expectedString): void
public function testToString(Array_ $array, string $expectedString): void
{
$this->assertSame($expectedString, (string) $array);
}

/**
* @return mixed[]
* @return array<string, array{Array_, string}>
*/
public function provideArrays(): array
public function provideToStringData(): array
{
return [
'simple array' => [new Array_(), 'array'],
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/Types/BooleanTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

final class BooleanTest extends TestCase
{
public function testBooleanStringifyCorrectly(): void
public function testToString(): void
{
$type = new Boolean();

Expand Down
Loading