심포니 2.1 프로젝트를 테스트하기 위해 Behat과 Mink를 사용하려고합니다.behat와 mink를 사용하여 심포니 2.1 프로젝트 테스트하기
내 FeatureContext.php :
<?php
use Behat\Behat\Context\ClosuredContextInterface,
Behat\Behat\Context\BehatContext,
Behat\Behat\Exception\PendingException,
Behat\Behat\Context\Step;
use Behat\Gherkin\Node\PyStringNode,
Behat\Gherkin\Node\TableNode;
use Behat\MinkExtension\Context\MinkContext;
//
// Require 3rd-party libraries here:
//
// require_once 'PHPUnit/Autoload.php';
// require_once 'PHPUnit/Framework/Assert/Functions.php';
//
/**
* Features context.
*/
class FeatureContext extends Behat\MinkExtension\Context\MinkContext {
/**
* Initializes context.
* Every scenario gets it's own context object.
*
* @param array $parameters context parameters (set them up through behat.yml)
*/
public function __construct(array $parameters)
{
// Initialize your context here
}
//
// Place your definition and hook methods here:
//
// /**
// * @Given /^I have done something with "([^"]*)"$/
// */
// public function iHaveDoneSomethingWith($argument)
// {
// doSomethingWith($argument);
// }
//
}
composer.json
"behat/behat": ">=2.2.2",
"behat/mink": ">=1.3.2",
"behat/symfony2-extension": "*",
"behat/mink-extension": "*",
"behat/mink-browserkit-driver": "*",
"behat/mink-selenium-driver": "*"
응용 프로그램/설정/behat.yml
default:
extensions:
Behat\Symfony2Extension\Extension:
mink_driver: true
kernel:
env: test
debug: true
Behat\MinkExtension\Extension:
base_url: 'http://localhost:8080/app_test.php/'
default_session: symfony2
javascript_session: selenium
selenium:
host: 127.0.0.1
port: 4444
내가 할 ./bin/behat 내가 할 때 :
기능 : 로그인사용자로 로그인하기 위해는 나는 사용자 이름과 암호를 검증 할 수 있어야합니다
시나리오 : 7 PHP 치명적인 오류 : 멤버 함수에 대해 getSession에 전화 링크 페이지 번호 기능/login.feature 로그인하기() 비선형 객체에 대한 getSession() 멤버 함수를 호출하십시오. vendor/behat/mink-extension/src/Behat/MinkExtension/Context/RawMinkContext.php in line
아이디어가 있으십니까?
V.