Simplify services definition in Behat
This commit is contained in:
@@ -35,7 +35,7 @@ Feature: Injecting parameters into context
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
Scenario: Injecting a parameter into a context explicitly set as public
|
Scenario: Injecting a parameter into a context explicitly set as public
|
||||||
Given a services file "config/services.yaml" containing:
|
Given a YAML services file containing:
|
||||||
"""
|
"""
|
||||||
services:
|
services:
|
||||||
App\Tests\SomeContext:
|
App\Tests\SomeContext:
|
||||||
@@ -47,7 +47,7 @@ Feature: Injecting parameters into context
|
|||||||
Then it should pass
|
Then it should pass
|
||||||
|
|
||||||
Scenario: Injecting a parameter into an autoconfigured context
|
Scenario: Injecting a parameter into an autoconfigured context
|
||||||
Given a services file "config/services.yaml" containing:
|
Given a YAML services file containing:
|
||||||
"""
|
"""
|
||||||
services:
|
services:
|
||||||
_defaults:
|
_defaults:
|
||||||
|
|||||||
@@ -123,6 +123,14 @@ CON
|
|||||||
$this->thereIsFile('config/services.yaml', '');
|
$this->thereIsFile('config/services.yaml', '');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Given /^a YAML services file containing:$/
|
||||||
|
*/
|
||||||
|
public function yamlServicesFile($content): void
|
||||||
|
{
|
||||||
|
$this->thereIsFile('config/services.yaml', (string) $content);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Given /^a Behat configuration containing(?: "([^"]+)"|:)$/
|
* @Given /^a Behat configuration containing(?: "([^"]+)"|:)$/
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user