Skip to content

Commit

Permalink
Fix PHP CS rule name
Browse files Browse the repository at this point in the history
  • Loading branch information
mcg-web committed May 4, 2021
1 parent 5b10c26 commit 5b7ed69
Show file tree
Hide file tree
Showing 17 changed files with 448 additions and 448 deletions.
2 changes: 1 addition & 1 deletion .php_cs.dist
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ return PhpCsFixer\Config::create()
->setRules(
[
'@Symfony' => true,
'@PHP71Migration' => true,
'@PHP74Migration' => true,
'@PHP74Migration:risky' => true,
'ordered_imports' => ['imports_order' => ['class', 'function', 'const']],
'general_phpdoc_annotation_remove' => ['author', 'category', 'copyright', 'created', 'license', 'package', 'since', 'subpackage', 'version'],
Expand Down
8 changes: 4 additions & 4 deletions tests/Executor/Promise/Adapter/ReactPromiseAdapterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ public function testWaitAsyncPromise(): void
{
$output = 'OK!';
$process = new PhpProcess(<<<EOF
<?php
usleep(30);
echo '$output';
EOF
<?php
usleep(30);
echo '$output';
EOF
);
$result = new ExecutionResult(['output' => $output]);

Expand Down
36 changes: 18 additions & 18 deletions tests/Functional/Command/CompileCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,29 +66,29 @@ public function testVerboseGeneration(): void
private function displayExpected(bool $isVerbose = false): string
{
$display = <<<'OUTPUT'
Types compilation starts
Types compilation ends successfully
Types compilation starts
Types compilation ends successfully

OUTPUT;
OUTPUT;

if ($isVerbose) {
$display .= <<<'OUTPUT'
Summary
=======
\-[\-]+\s+\-[\-]+\s
class\s+path\s*
\-[\-]+\s+\-[\-]+\s
Overblog\\GraphQLBundle\\Connection\\__DEFINITIONS__\\QueryType {{PATH}}/QueryType\.php
Overblog\\GraphQLBundle\\Connection\\__DEFINITIONS__\\UserType {{PATH}}/UserType\.php
Overblog\\GraphQLBundle\\Connection\\__DEFINITIONS__\\friendConnectionType {{PATH}}/friendConnectionType\.php
Overblog\\GraphQLBundle\\Connection\\__DEFINITIONS__\\userConnectionType {{PATH}}/userConnectionType\.php
Overblog\\GraphQLBundle\\Connection\\__DEFINITIONS__\\PageInfoType {{PATH}}/PageInfoType\.php
Overblog\\GraphQLBundle\\Connection\\__DEFINITIONS__\\friendEdgeType {{PATH}}/friendEdgeType\.php
Overblog\\GraphQLBundle\\Connection\\__DEFINITIONS__\\userEdgeType {{PATH}}/userEdgeType\.php
\-[\-]+\s+\-[\-]+\s
OUTPUT;
Summary
=======
\-[\-]+\s+\-[\-]+\s
class\s+path\s*
\-[\-]+\s+\-[\-]+\s
Overblog\\GraphQLBundle\\Connection\\__DEFINITIONS__\\QueryType {{PATH}}/QueryType\.php
Overblog\\GraphQLBundle\\Connection\\__DEFINITIONS__\\UserType {{PATH}}/UserType\.php
Overblog\\GraphQLBundle\\Connection\\__DEFINITIONS__\\friendConnectionType {{PATH}}/friendConnectionType\.php
Overblog\\GraphQLBundle\\Connection\\__DEFINITIONS__\\userConnectionType {{PATH}}/userConnectionType\.php
Overblog\\GraphQLBundle\\Connection\\__DEFINITIONS__\\PageInfoType {{PATH}}/PageInfoType\.php
Overblog\\GraphQLBundle\\Connection\\__DEFINITIONS__\\friendEdgeType {{PATH}}/friendEdgeType\.php
Overblog\\GraphQLBundle\\Connection\\__DEFINITIONS__\\userEdgeType {{PATH}}/userEdgeType\.php
\-[\-]+\s+\-[\-]+\s
OUTPUT;

$display = str_replace('{{PATH}}', preg_quote($this->cacheDir), $display);
}
Expand Down
74 changes: 37 additions & 37 deletions tests/Functional/Controller/GraphControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,30 @@
class GraphControllerTest extends TestCase
{
private string $friendsQuery = <<<'EOF'
query FriendsQuery {
user {
friends(first: 2) {
totalCount
edges {
friendshipTime
node {
name
query FriendsQuery {
user {
friends(first: 2) {
totalCount
edges {
friendshipTime
node {
name
}
}
}
}
}
}
}
EOF;
EOF;

private string $friendsTotalCountQuery = <<<'EOF'
query FriendsTotalCountQuery {
user {
friends {
totalCount
query FriendsTotalCountQuery {
user {
friends {
totalCount
}
}
}
}
}
EOF;
EOF;

private array $expectedData = [
'user' => [
Expand Down Expand Up @@ -127,20 +127,20 @@ public function testEndpointActionWithVariables(): void
$this->disableCatchExceptions($client);

$query = <<<'EOF'
query FriendsQuery($firstFriends: Int) {
user {
friends(first: $firstFriends) {
totalCount
edges {
friendshipTime
node {
name
query FriendsQuery($firstFriends: Int) {
user {
friends(first: $firstFriends) {
totalCount
edges {
friendshipTime
node {
name
}
}
}
}
}
}
}
EOF;
EOF;

$content = json_encode(['query' => $query, 'variables' => '{"firstFriends": 2}']) ?: null;
$client->request('GET', '/', [], [], ['CONTENT_TYPE' => 'application/json'], $content);
Expand All @@ -155,10 +155,10 @@ public function testEndpointActionWithInvalidVariables(): void
$this->disableCatchExceptions($client);

$query = <<<'EOF'
query {
user
}
EOF;
query {
user
}
EOF;

$client->request('GET', '/', ['query' => $query, 'variables' => '"firstFriends": 2}']);
}
Expand All @@ -171,10 +171,10 @@ public function testMultipleEndpointActionWithUnknownSchemaName(): void
$this->disableCatchExceptions($client);

$query = <<<'EOF'
query {
user
}
EOF;
query {
user
}
EOF;

$client->request('GET', '/graphql/fake', ['query' => $query]);
}
Expand Down
8 changes: 4 additions & 4 deletions tests/Functional/Exception/ExceptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ protected function setUp(): void
public function testExceptionIsMappedToAWarning(): void
{
$query = <<<'EOF'
query ExceptionQuery {
test
}
EOF;
query ExceptionQuery {
test
}
EOF;

$expectedData = [
'test' => null,
Expand Down
40 changes: 20 additions & 20 deletions tests/Functional/MultipleQueries/MultipleQueriesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ protected function setUp(): void
public function testRequiredFails(): void
{
$query = <<<'EOF'
{
fail: failRequire
success: success
}
EOF;
{
fail: failRequire
success: success
}
EOF;
$result = $this->executeGraphQLRequest($query);
$this->assertSame(self::REQUIRED_FAILS_ERRORS, $result['errors']);
$this->assertTrue(empty($result['data']));
Expand All @@ -69,23 +69,23 @@ public function testRequiredFails(): void
public function testOptionalFails(): void
{
$query = <<<'EOF'
{
fail: failOptional
success: success
}
EOF;
{
fail: failOptional
success: success
}
EOF;
$result = $this->executeGraphQLRequest($query);
$this->assertSame(self::OPTIONAL_FAILS, $result);
}

public function testMutationRequiredFails(): void
{
$query = <<<'EOF'
mutation {
fail: failRequire
success: success
}
EOF;
mutation {
fail: failRequire
success: success
}
EOF;
$result = $this->executeGraphQLRequest($query);
$this->assertSame(self::REQUIRED_FAILS_ERRORS, $result['errors']);
$this->assertTrue(empty($result['data']));
Expand All @@ -94,11 +94,11 @@ public function testMutationRequiredFails(): void
public function testMutationOptionalFails(): void
{
$query = <<<'EOF'
mutation {
fail: failOptional
success: success
}
EOF;
mutation {
fail: failOptional
success: success
}
EOF;
$result = $this->executeGraphQLRequest($query);
$this->assertSame(self::OPTIONAL_FAILS, $result);
}
Expand Down
30 changes: 15 additions & 15 deletions tests/Functional/MultipleSchema/MultipleSchemaTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ public function testPublicSchema(): void
$this->assertSame([['node' => ['username' => 'user1']]], $result['data']['users']['edges']);

$query = <<<'EOF'
mutation M {
addUser(input: {username: "user1"}) {
user {
username
mutation M {
addUser(input: {username: "user1"}) {
user {
username
}
}
}
}
}
EOF;
EOF;

$expectedData = [
'addUser' => [
Expand All @@ -55,15 +55,15 @@ public function testInternalSchema(): void
$this->assertSame([['node' => ['username' => 'user1', 'email' => 'topsecret']]], $result['data']['users']['edges']);

$query = <<<'EOF'
mutation M {
addUser(input: {username: "user1"}) {
user {
username
email
mutation M {
addUser(input: {username: "user1"}) {
user {
username
email
}
}
}
}
}
EOF;
EOF;

$expectedData = [
'addUser' => [
Expand Down
Loading

0 comments on commit 5b7ed69

Please sign in to comment.