X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fbehat%2Fbehat%2Fsrc%2FBehat%2FBehat%2FTransformation%2FTransformation%2FTableRowTransformation.php;fp=vendor%2Fbehat%2Fbehat%2Fsrc%2FBehat%2FBehat%2FTransformation%2FTransformation%2FTableRowTransformation.php;h=0000000000000000000000000000000000000000;hp=571f1f0cd1c62dd6b37b238c2e0912b1cc6fa513;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0 diff --git a/vendor/behat/behat/src/Behat/Behat/Transformation/Transformation/TableRowTransformation.php b/vendor/behat/behat/src/Behat/Behat/Transformation/Transformation/TableRowTransformation.php deleted file mode 100644 index 571f1f0cd..000000000 --- a/vendor/behat/behat/src/Behat/Behat/Transformation/Transformation/TableRowTransformation.php +++ /dev/null @@ -1,118 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Behat\Behat\Transformation\Transformation; - -use Behat\Behat\Definition\Call\DefinitionCall; -use Behat\Behat\Transformation\Call\TransformationCall; -use Behat\Behat\Transformation\SimpleArgumentTransformation; -use Behat\Gherkin\Node\TableNode; -use Behat\Testwork\Call\CallCenter; -use Behat\Testwork\Call\RuntimeCallee; -use ReflectionMethod; - -/** - * Table row transformation. - * - * @author Konstantin Kudryashov - */ -final class TableRowTransformation extends RuntimeCallee implements SimpleArgumentTransformation -{ - const PATTERN_REGEX = '/^row\:[[:print:]]+$/'; - - /** - * @var string - */ - private $pattern; - - /** - * {@inheritdoc} - */ - static public function supportsPatternAndMethod($pattern, ReflectionMethod $method) - { - return 1 === preg_match(self::PATTERN_REGEX, $pattern); - } - - /** - * Initializes transformation. - * - * @param string $pattern - * @param callable $callable - * @param null|string $description - */ - public function __construct($pattern, $callable, $description = null) - { - $this->pattern = $pattern; - - parent::__construct($callable, $description); - } - - /** - * {@inheritdoc} - */ - public function supportsDefinitionAndArgument(DefinitionCall $definitionCall, $argumentIndex, $argumentValue) - { - if (!$argumentValue instanceof TableNode) { - return false; - }; - - return $this->pattern === 'row:' . implode(',', $argumentValue->getRow(0)); - } - - /** - * {@inheritdoc} - */ - public function transformArgument(CallCenter $callCenter, DefinitionCall $definitionCall, $argumentIndex, $argumentValue) - { - $rows = array(); - foreach ($argumentValue as $row) { - $call = new TransformationCall( - $definitionCall->getEnvironment(), - $definitionCall->getCallee(), - $this, - array($row) - ); - - $result = $callCenter->makeCall($call); - - if ($result->hasException()) { - throw $result->getException(); - } - - $rows[] = $result->getReturn(); - } - - return $rows; - } - - /** - * {@inheritdoc} - */ - public function getPriority() - { - return 50; - } - - /** - * {@inheritdoc} - */ - public function getPattern() - { - return $this->pattern; - } - - /** - * {@inheritdoc} - */ - public function __toString() - { - return 'TableRowTransform ' . $this->pattern; - } -}