PendingExceptionを投げる

作成した条件に一致しなかった時(ようするにテストにコケた時)に、てっきりreturn falseすればいいものと思いこんでいたら違ったのでメモ

PendingExceptionをthrowすればよいらしい

features/bootstrap/FeatureContext.php
<?php
use Behat\Behat\Tester\Exception\PendingException;    // ← ※追記

class FeatureContext extends RawMinkContext implements Context, SnippetAcceptingContext
{
	(中略)

	/**
	 * @Then :element 要素の :attribute 属性に :text がセットされていること
	 *
	 * @param	string $element
	 * @param	string $attribute
	 * @param	string $text
	 */
	public function hogeCheck($element, $attribute, $text)
	{
		$elements = $this->getSession()->getPage()->findAll("css", $element);

		if(count($elements) > 0)
		{
			foreach($elements as $i => $row)
			{
				if($text === $row->getAttribute($attribute))
				{
				}else{
					throw new PendingException(" \"".$text."\" と \"".$row->getAttribute($attribute)."\" は一致しません");
				}
			}
		}else{
			throw new PendingException($element. "要素が見つかりません"); // ←これ
		}

	}