Skip to content

Commit 5f1194a

Browse files
author
Jeremiah VALERIE
committed
Bump phpunit
1 parent 44a161a commit 5f1194a

File tree

2 files changed

+18
-26
lines changed

2 files changed

+18
-26
lines changed

tests/Generator/TypeGeneratorModeTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,14 @@
1313

1414
use Overblog\GraphQLGenerator\Generator\TypeGenerator;
1515
use Overblog\GraphQLGenerator\Tests\TestCase;
16+
use PHPUnit\Framework\MockObject\MockObject;
1617

1718
class TypeGeneratorModeTest extends TestCase
1819
{
1920
/** @var string */
2021
private $dir;
2122

22-
/** @var TypeGenerator|\PHPUnit_Framework_MockObject_MockObject */
23+
/** @var TypeGenerator|MockObject */
2324
private $typeGenerator;
2425

2526
private const CONFIG = [

tests/Generator/TypeGeneratorTest.php

Lines changed: 16 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -18,43 +18,35 @@
1818
use GraphQL\Type\Definition\ObjectType;
1919
use GraphQL\Type\Definition\StringType;
2020
use GraphQL\Type\Definition\Type;
21+
use Overblog\GraphQLGenerator\Generator\TypeGenerator;
2122

2223
class TypeGeneratorTest extends AbstractTypeGeneratorTest
2324
{
24-
/**
25-
* @expectedException \InvalidArgumentException
26-
* @expectedExceptionMessage Skeleton dir "fake" not found.
27-
*/
2825
public function testWrongSetSkeletonDirs(): void
2926
{
27+
$this->expectException(\InvalidArgumentException::class);
28+
$this->expectExceptionMessage('Skeleton dir "fake" not found.');
3029
$this->typeGenerator->setSkeletonDirs(['fake']);
3130
}
3231

33-
/**
34-
* @expectedException \InvalidArgumentException
35-
* @expectedExceptionMessage Skeleton dir must be string or object implementing __toString, "array" given.
36-
*/
3732
public function testWrongAddSkeletonDir(): void
3833
{
34+
$this->expectException(\InvalidArgumentException::class);
35+
$this->expectExceptionMessage('Skeleton dir must be string or object implementing __toString, "array" given.');
3936
$this->typeGenerator->addSkeletonDir([]);
4037
}
4138

42-
/**
43-
* @expectedException \InvalidArgumentException
44-
* @expectedExceptionMessage Skeleton dirs must be array or object implementing \Traversable interface, "object" given.
45-
*/
4639
public function testWrongObjectSetSkeletonDir(): void
4740
{
41+
$this->expectException(\InvalidArgumentException::class);
42+
$this->expectExceptionMessage('Skeleton dirs must be array or object implementing \Traversable interface, "object" given.');
4843
$this->typeGenerator->setSkeletonDirs(new \stdClass());
4944
}
5045

51-
52-
/**
53-
* @expectedException \InvalidArgumentException
54-
* @expectedExceptionMessageRegExp /Skeleton "fake" could not be found in .*\/skeleton./
55-
*/
5646
public function testWrongGetSkeletonDirs(): void
5747
{
48+
$this->expectException(\InvalidArgumentException::class);
49+
$this->expectExceptionMessageRegExp('/Skeleton "fake" could not be found in .*\/skeleton./');
5850
$this->typeGenerator->getSkeletonContent('fake');
5951
}
6052

@@ -88,12 +80,10 @@ public function testTypeAlias2String(): void
8880
);
8981
}
9082

91-
/**
92-
* @expectedException \RuntimeException
93-
* @expectedExceptionMessage Malformed ListOf wrapper type "[String" expected "]" but got "g".
94-
*/
9583
public function testTypeAlias2StringInvalidListOf(): void
9684
{
85+
$this->expectException(\RuntimeException::class);
86+
$this->expectExceptionMessage('Malformed ListOf wrapper type "[String" expected "]" but got "g".');
9787
$this->generateClasses([
9888
'T' => [
9989
'type' => 'object',
@@ -158,12 +148,13 @@ public function testCallbackEntryDoesNotTreatObject(): void
158148
$this->assertEquals(['result' => 1], $resolveFn());
159149
}
160150

161-
/**
162-
* @expectedException \RuntimeException
163-
* @expectedExceptionMessage Generator [Overblog\GraphQLGenerator\Generator\TypeGenerator::generateFake] for placeholder "fake" is not callable.
164-
*/
165151
public function testProcessInvalidPlaceHoldersReplacements(): void
166152
{
153+
$this->expectException(\RuntimeException::class);
154+
$this->expectExceptionMessage(\sprintf(
155+
'Generator [%s::generateFake] for placeholder "fake" is not callable.',
156+
TypeGenerator::class
157+
));
167158
$this->typeGenerator->setSkeletonDirs(__DIR__.'/../Resources/Skeleton');
168159

169160
$this->generateClasses($this->getConfigs());

0 commit comments

Comments
 (0)