Questa è la mia struttura di directory:Behat - Classe di contesto non trovata.
composer.json
composer.phar
vendor/
bin/
behat
tests/
functional/
behat.yml
features/
registration.feature
bootstrap/
FeatureContext.php
ho fatto:
cd tests/functional
../../vendor/bin/behat --init
che ha creato la struttura di base per me. Questo è all'interno behat.yml:
default:
paths:
features: '%behat.paths.base%/features'
bootstrap: '%behat.paths.base%/features/bootstrap'
Ora cerco di eseguire i test BDD come questo:
vendor/bin/behat -c tests/functional/behat.yml
e ottengo:
[RuntimeException]
Context class not found.
Maybe you have provided wrong or no `bootstrap` path in your behat.yml:
http://docs.behat.org/guides/7.config.html#paths
behat [--init] [-f|--format="..."] [--out="..."] [--lang="..."] [--[no-]ansi] [--[no-]time] [--[no-]paths] [--[no-]snippets] [--[no-]snippets-paths] [--[no-]multiline] [--[no-]expand] [--story-syntax] [-d|--definitions="..."] [--name="..."] [--tags="..."] [--cache="..."] [--strict] [--dry-run] [--rerun="..."] [--append-snippets] [--append-to="..."] [features]
Qualsiasi idea di qual è il problema?
Ho installato Behat tramite Composer. Questo è il mio composer.json:
{
"name": "hello",
"description": "Hello World",
"minimum-stability": "dev",
"require": {
"php": ">=5.3",
"zendframework/zendframework": "2.1.4",
"doctrine/common": "dev-master#d7987c96675e153638729383577090feed9854f1"
},
"require-dev": {
"phpunit/phpunit": "3.7.14",
"behat/behat": "2.4.*@stable"
}
}
che ho installato con:
php composer.phar install --dev -o
Ancora ottenere lo stesso errore. Devo mantenere questa struttura di cartelle in quanto è una convenzione di progetto. Non può essere nella cartella principale. –
Non voglio cambiare cartella bin. Sto usando anche altre librerie e i loro binari sono in vendor/bin / –