@@ -8,7 +8,13 @@ |
||
| 8 | 8 | { |
| 9 | 9 | public function build($uri = null, array $queries = null, array $headers = null, array $postBody = null, $body = null, array $options = []); |
| 10 | 10 | |
| 11 | + /** |
|
| 12 | + * @return void |
|
| 13 | + */ |
|
| 11 | 14 | public function setClient(ClientInterface $client = null); |
| 12 | 15 | |
| 16 | + /** |
|
| 17 | + * @return ClientInterface|null |
|
| 18 | + */ |
|
| 13 | 19 | public function getClient(); |
| 14 | 20 | } |
@@ -2,8 +2,8 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Knp\FriendlyContexts\Context; |
| 4 | 4 | |
| 5 | -use Behat\Gherkin\Node\TableNode; |
|
| 6 | 5 | use Behat\Gherkin\Node\PyStringNode; |
| 6 | +use Behat\Gherkin\Node\TableNode; |
|
| 7 | 7 | use Guzzle\Http\Exception\BadResponseException; |
| 8 | 8 | use Knp\FriendlyContexts\Http\Security\HttpExtension; |
| 9 | 9 | |
@@ -93,6 +93,9 @@ discard block |
||
| 93 | 93 | return $this->get('friendly.http.http_content_type_guesser'); |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | + /** |
|
| 97 | + * @param string $service |
|
| 98 | + */ |
|
| 96 | 99 | protected function get($service) |
| 97 | 100 | { |
| 98 | 101 | if ($this->container->has($service)) { |
@@ -106,6 +109,9 @@ discard block |
||
| 106 | 109 | throw new ServiceNotFoundException($service); |
| 107 | 110 | } |
| 108 | 111 | |
| 112 | + /** |
|
| 113 | + * @param string $name |
|
| 114 | + */ |
|
| 109 | 115 | protected function getParameter($name) |
| 110 | 116 | { |
| 111 | 117 | if ($this->container->hasParameter($name)) { |
@@ -18,6 +18,9 @@ |
||
| 18 | 18 | $this->container = $container; |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | + /** |
|
| 22 | + * @param ContextInterface $context |
|
| 23 | + */ |
|
| 21 | 24 | public function supports($context) |
| 22 | 25 | { |
| 23 | 26 | return $context instanceof Context; |
@@ -2,10 +2,10 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Knp\FriendlyContexts\Context\Initializer; |
| 4 | 4 | |
| 5 | -use Behat\Behat\Context\Initializer\ContextInitializer; |
|
| 6 | 5 | use Behat\Behat\Context\Context as ContextInterface; |
| 7 | -use Symfony\Component\DependencyInjection\ContainerInterface; |
|
| 6 | +use Behat\Behat\Context\Initializer\ContextInitializer; |
|
| 8 | 7 | use Knp\FriendlyContexts\Context\Context; |
| 8 | +use Symfony\Component\DependencyInjection\ContainerInterface; |
|
| 9 | 9 | |
| 10 | 10 | class FriendlyInitializer implements ContextInitializer |
| 11 | 11 | { |
@@ -160,6 +160,9 @@ |
||
| 160 | 160 | return $elements; |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | + /** |
|
| 164 | + * @param \Closure $actionCallback |
|
| 165 | + */ |
|
| 163 | 166 | protected function elementAction($locator, $element, $nbr = 1, $actionCallback, $filterCallback = null) |
| 164 | 167 | { |
| 165 | 168 | $elements = $this->searchElement($locator, $element, $filterCallback); |
@@ -26,6 +26,11 @@ discard block |
||
| 26 | 26 | $this->minkParameters = $parameters; |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | + /** |
|
| 30 | + * @param string $offset |
|
| 31 | + * |
|
| 32 | + * @return string |
|
| 33 | + */ |
|
| 29 | 34 | public function getMinkParameter($offset) |
| 30 | 35 | { |
| 31 | 36 | if (!isset($this->minkParameters[$offset])) { |
@@ -48,6 +53,9 @@ discard block |
||
| 48 | 53 | return $this->getMink()->assertSession($name); |
| 49 | 54 | } |
| 50 | 55 | |
| 56 | + /** |
|
| 57 | + * @return string |
|
| 58 | + */ |
|
| 51 | 59 | public function locatePath($path) |
| 52 | 60 | { |
| 53 | 61 | $startUrl = rtrim($this->getMinkParameter('base_url'), '/') . '/'; |
@@ -2,8 +2,8 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Knp\FriendlyContexts\Context; |
| 4 | 4 | |
| 5 | -use Behat\Mink\Mink; |
|
| 6 | 5 | use Behat\MinkExtension\Context\MinkAwareContext; |
| 6 | +use Behat\Mink\Mink; |
|
| 7 | 7 | |
| 8 | 8 | abstract class RawMinkContext extends Context implements MinkAwareContext |
| 9 | 9 | { |
@@ -10,11 +10,17 @@ discard block |
||
| 10 | 10 | { |
| 11 | 11 | private $pages = []; |
| 12 | 12 | |
| 13 | + /** |
|
| 14 | + * @param TableNode $arguments |
|
| 15 | + */ |
|
| 13 | 16 | public function visitPage($page, $arguments = null) |
| 14 | 17 | { |
| 15 | 18 | $this->getSession()->visit($this->locatePath($this->getPagePath($page, $arguments))); |
| 16 | 19 | } |
| 17 | 20 | |
| 21 | + /** |
|
| 22 | + * @param TableNode $arguments |
|
| 23 | + */ |
|
| 18 | 24 | public function assertPage($page, $arguments = null) |
| 19 | 25 | { |
| 20 | 26 | try { |
@@ -52,6 +58,10 @@ discard block |
||
| 52 | 58 | return $this->resolvePagePath($page, $parameters, $entities); |
| 53 | 59 | } |
| 54 | 60 | |
| 61 | + /** |
|
| 62 | + * @param string $entity |
|
| 63 | + * @param string $field |
|
| 64 | + */ |
|
| 55 | 65 | protected function getEntityFromRecordBag($entity, $field) |
| 56 | 66 | { |
| 57 | 67 | $class = $this->resolveEntity($entity)->getName(); |
@@ -2,9 +2,9 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Knp\FriendlyContexts\Context; |
| 4 | 4 | |
| 5 | -use Symfony\Component\PropertyAccess\PropertyAccess; |
|
| 6 | -use Knp\FriendlyContexts\Page\Page; |
|
| 7 | 5 | use Behat\Gherkin\Node\TableNode; |
| 6 | +use Knp\FriendlyContexts\Page\Page; |
|
| 7 | +use Symfony\Component\PropertyAccess\PropertyAccess; |
|
| 8 | 8 | |
| 9 | 9 | class RawPageContext extends RawMinkContext |
| 10 | 10 | { |
@@ -2,10 +2,10 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Knp\FriendlyContexts\Definition; |
| 4 | 4 | |
| 5 | -use Behat\Testwork\Environment\Environment; |
|
| 5 | +use Behat\Behat\Definition\DefinitionFinder as BaseDefinitionFinder; |
|
| 6 | 6 | use Behat\Gherkin\Node\FeatureNode; |
| 7 | 7 | use Behat\Gherkin\Node\StepNode; |
| 8 | -use Behat\Behat\Definition\DefinitionFinder as BaseDefinitionFinder; |
|
| 8 | +use Behat\Testwork\Environment\Environment; |
|
| 9 | 9 | |
| 10 | 10 | class DefinitionFinder |
| 11 | 11 | { |
@@ -43,6 +43,9 @@ |
||
| 43 | 43 | return true; |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | + /** |
|
| 47 | + * @param string $name |
|
| 48 | + */ |
|
| 46 | 49 | protected function getTagContent($name) |
| 47 | 50 | { |
| 48 | 51 | $content = []; |