Skip to content

Commit 6921c7b

Browse files
author
junaid farooq
committed
+ Fixes PSR4 auto-loading issue in the test case fpr dump graphql schema command
+ Fixes code styling in the same test class + Replaces the deprecated assertion with the recommended one + Installs phpunit library + Fixes schema location path in phpunit xml + Adds a composer.lock file + Removes composer.lock file from .gitignore file
1 parent 3afc2ee commit 6921c7b

File tree

5 files changed

+8096
-8
lines changed

5 files changed

+8096
-8
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/vendor/
2-
/composer.lock
32
/build
43
/var
54
/cache
Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
<?php
22

3-
43
namespace TheCodingMachine\Graphqlite\Bundle\Tests\Command;
54

6-
75
use PHPUnit\Framework\TestCase;
6+
use Symfony\Bundle\FrameworkBundle\Console\Application;
87
use Symfony\Component\Console\Tester\CommandTester;
98
use TheCodingMachine\Graphqlite\Bundle\Tests\GraphqliteTestingKernel;
10-
use Symfony\Bundle\FrameworkBundle\Console\Application;
119

1210
class DumpSchemaCommandTest extends TestCase
1311
{
14-
public function testExecute()
12+
/**
13+
* @test
14+
*/
15+
public function it_executes_successfully(): void
1516
{
1617
$kernel = new GraphqliteTestingKernel();
1718
$application = new Application($kernel);
@@ -20,7 +21,7 @@ public function testExecute()
2021
$commandTester = new CommandTester($command);
2122
$commandTester->execute([]);
2223

23-
$this->assertRegExp(
24+
self::assertMatchesRegularExpression(
2425
'/type Product {[\s"]*seller: Contact\s*name: String!\s*price: Float!\s*}/',
2526
$commandTester->getDisplay()
2627
);

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@
4141
"symfony/phpunit-bridge": "^5.3",
4242
"thecodingmachine/phpstan-strict-rules": "^v0.12.1",
4343
"composer/package-versions-deprecated": "^1.8",
44-
"phpstan/phpstan-webmozart-assert": "^0.12.12"
44+
"phpstan/phpstan-webmozart-assert": "^0.12.12",
45+
"phpunit/phpunit": "^9.5"
4546
},
4647
"conflict": {
4748
"mouf/classname-mapper": "<1.0.2",

0 commit comments

Comments
 (0)