Conversation
mnocon
left a comment
There was a problem hiding this comment.
Looks good! Couple of comments, mostly about constistency with other Behat tests.
| Scenario: An application maintainer generates the schema | ||
| Given the schema has not been generated | ||
| When I run the command "ezplatform:graphql:generate-schema" | ||
| When I clear the cache |
There was a problem hiding this comment.
Nitpick: usually we replace the second consecutive usage with And (And I clear the cache)
| paths: | ||
| - '%paths.base%/vendor/ezsystems/ezplatform-graphql/features/Generator.feature' | ||
| contexts: | ||
| - GeneratorContext |
There was a problem hiding this comment.
Usually we keep the Context classes in Context directories, also define namespaces for them - I think it would be useful to do that here as well, to keep it consistent.
features/bootstrap/CacheContext.php
Outdated
| * @license For full copyright and license information view LICENSE file distributed with this source code. | ||
| */ | ||
|
|
||
| class CacheContext implements \Behat\Symfony2Extension\Context\KernelAwareContext |
| /** | ||
| * @var \Symfony\Component\HttpKernel\KernelInterface | ||
| */ | ||
| private $kernel; |
There was a problem hiding this comment.
This is a matter of taste, but I prefer to use KernelDictionary (https://github.com/Behat/Symfony2Extension/blob/master/src/Behat/Symfony2Extension/Context/KernelDictionary.php), as it results in less boilerplate (no need to add a setter)
| } | ||
|
|
||
| /** | ||
| * @Given /^the schema has not been generated$/ |
There was a problem hiding this comment.
Usually I struggle with steps like this one, because I understand them differently when they're used as Given or Then (and then I have to look at the code what they do).
The way I see it:
Given the schema has not been generated - check that the directory is empty, remove files if they exist
Then the schema has not been generated - assert that the directory is empty, fail the step if the files are there
Of course this is a minor thing, because I don't imagine people using Then the schema has not been generated, but I'm curious what's your take on this 😉
Features
ezplatform-graphql/features/Generator.Feature
Lines 1 to 4 in bb70805
TODO