Skip to content

Commit 916297c

Browse files
committed
📦 Make test more stable
Avoid fail because of the changed field order
1 parent d16a09d commit 916297c

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

tests/Command/DumpSchemaCommandTest.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,20 @@ public function testExecute(): void
1818
$commandTester = new CommandTester($command);
1919
$commandTester->execute([]);
2020

21+
preg_match('/type Product \{(?P<body>[\s\S]*?)}/', $commandTester->getDisplay(), $matches);
22+
self::assertArrayHasKey('body', $matches);
23+
24+
self::assertMatchesRegularExpression(
25+
'/name: String!/',
26+
$matches['body']
27+
);
28+
self::assertMatchesRegularExpression(
29+
'/price: Float!/',
30+
$matches['body']
31+
);
2132
self::assertMatchesRegularExpression(
22-
'/type Product {[\s"]*name: String!\s*price: Float!\s*seller: Contact\s*}/',
23-
$commandTester->getDisplay()
33+
'/seller: Contact/',
34+
$matches['body']
2435
);
2536
}
2637
}

0 commit comments

Comments
 (0)