Codeception: Bootstrap/Configuration not found running new suit test

Created on 19 Feb 2018  Β·  3Comments  Β·  Source: Codeception/Codeception

What are you trying to achieve?

Generate a new suit for REST

  1. composer require codeception/codeception --dev
  2. ./vendor/bin/codecept generate:suite api
  3. ./vendor/bin/codecept generate:cept api UserLoginCept
  4. Running testes

What do you get instead?

Provide console output if related. Use -vvv mode for more details.

  1. ./vendor/bin/codecept run -v
Codeception PHP Testing Framework v2.0.9Powered by PHPUnit 4.3.5 by Sebastian Bergmann.
Functional Tests (0) ------------------------
Modules: Filesystem, FunctionalHelper---------------------------------------------
---------------------------------------------
Unit Tests (0) ------------------------------Modules: Asserts, UnitHelper---------------------------------------------
---------------------------------------------

Acceptance Tests (0) ------------------------
Modules: PhpBrowser, AcceptanceHelper
---------------------------------------------
---------------------------------------------


  [PHPUnit_Framework_Exception]
  Illegal offset type in isset or empty


Exception trace:
 () at /var/www/html/websad-suite/vendor/codeception/codeception/src/Codeception/Subscriber/ErrorHandler.php:49
 Codeception\Subscriber\ErrorHandler->errorHandler() at /var/www/html/websad-suite/vendor/codeception/codeception/src/Codeception/Configuration.php:286
 Codeception\Configuration::modules() at /var/www/html/websad-suite/vendor/codeception/codeception/src/Codeception/SuiteManager.php:68
 Codeception\SuiteManager->initializeModules() at /var/www/html/websad-suite/vendor/codeception/codeception/src/Codeception/SuiteManager.php:60
 Codeception\SuiteManager->initialize() at /var/www/html/websad-suite/vendor/codeception/codeception/src/Codeception/Codecept.php:149
 Codeception\Codecept->runSuite() at /var/www/html/websad-suite/vendor/codeception/codeception/src/Codeception/Codecept.php:134
 Codeception\Codecept->run() at /var/www/html/websad-suite/vendor/codeception/codeception/src/Codeception/Command/Run.php:261
 Codeception\Command\Run->runSuites() at /var/www/html/websad-suite/vendor/codeception/codeception/src/Codeception/Command/Run.php:190
 Codeception\Command\Run->execute() at /var/www/html/websad-suite/vendor/symfony/console/Command/Command.php:242
 Symfony\Component\Console\Command\Command->run() at /var/www/html/websad-suite/vendor/symfony/console/Application.php:843
 Symfony\Component\Console\Application->doRunCommand() at /var/www/html/websad-suite/vendor/symfony/console/Application.php:193
 Symfony\Component\Console\Application->doRun() at /var/www/html/websad-suite/vendor/symfony/console/Application.php:117
 Symfony\Component\Console\Application->run() at /var/www/html/websad-suite/vendor/codeception/codeception/codecept:27

run [-c|--config CONFIG] [--report] [--html [HTML]] [--xml [XML]] [--tap [TAP]] [--json [JSON]] [--colors] [--no-colors] [--silent] [--steps] [-d|--debug] [--coverage [COVERAGE]] [--coverage-html [COVERAGE-HTML]] [--coverage-xml [COVERAGE-XML]] [--coverage-text [COVERAGE-TEXT]] [--no-exit] [-g|--group GROUP] [-s|--skip SKIP] [-sg|--skip-group SKIP-GROUP] [--env ENV] [-f|--fail-fast] [--] [<suite>] [<test>]
  1. ./vendor/bin/codecept run -c api -v
  [Codeception\Exception\Configuration]
  Configuration file could not be found.
  Run `bootstrap` to initialize Codeception.

Exception trace:
 () at /var/www/html/websad-suite/vendor/codeception/codeception/src/Codeception/Configuration.php:115
 Codeception\Configuration::config() at /var/www/html/websad-suite/vendor/codeception/codeception/src/Codeception/Command/Run.php:130
 Codeception\Command\Run->execute() at /var/www/html/websad-suite/vendor/symfony/console/Command/Command.php:242
 Symfony\Component\Console\Command\Command->run() at /var/www/html/websad-suite/vendor/symfony/console/Application.php:843
 Symfony\Component\Console\Application->doRunCommand() at /var/www/html/websad-suite/vendor/symfony/console/Application.php:193
 Symfony\Component\Console\Application->doRun() at /var/www/html/websad-suite/vendor/symfony/console/Application.php:117
 Symfony\Component\Console\Application->run() at /var/www/html/websad-suite/vendor/codeception/codeception/codecept:27

run [-c|--config CONFIG] [--report] [--html [HTML]] [--xml [XML]] [--tap [TAP]] [--json [JSON]] [--colors] [--no-colors] [--silent] [--steps] [-d|--debug] [--coverage [COVERAGE]] [--coverage-html [COVERAGE-HTML]] [--coverage-xml [COVERAGE-XML]] [--coverage-text [COVERAGE-TEXT]] [--no-exit] [-g|--group GROUP] [-s|--skip SKIP] [-sg|--skip-group SKIP-GROUP] [--env ENV] [-f|--fail-fast] [--] [<suite>] [<test>]
  1. ./vendor/bin/codecept bootstrap
Project is already initialized in '.'

Provide test source code if related

<?php 
/**
 * UserLoginCept
 */
$I = new ApiTester($scenario);
$I->wantTo('perform actions and see result');

Details

  • Codeception version: 2.0.9
  • PHP Version: 7.2
  • Operating System: Ubuntu 17.10
  • Installation type: Composer
  • List of installed packages (composer show)

alexandernst/yii2-device-detect 0.0.12 Yii2 extension for Mobile-Detect library
almasaeed2010/adminlte v2.4.3 AdminLTE - admin control panel and dashboard that...
bower-asset/bootstrap v3.3.7 The most popular front-end framework for developi...
bower-asset/bootstrap3-dialog v1.35.4 Make use of Bootstrap Modal more monkey-friendly....
bower-asset/inputmask 3.3.11 Inputmask is a javascript library which creates a...
bower-asset/jquery 3.2.1
bower-asset/jquery-ui 1.12.1
bower-asset/punycode v1.3.2
bower-asset/typeahead.js v0.11.1
bower-asset/yii2-pjax dev-master c39f239
cebe/markdown 1.1.2 A super fast, highly extensible markdown parser f...
cebe/yii2-gravatar 1.1 Gravatar Widget for Yii 2
cilex/cilex 1.1.0 The PHP micro-framework for Command line tools ba...
cilex/console-service-provider 1.0.0 Console Service Provider
codeception/codeception 2.0.9 BDD-style testing framework
composer/installers v1.5.0 A multi-framework Composer library installer
container-interop/container-interop 1.2.0 Promoting the interoperability of container objec...
dmstr/yii2-adminlte-asset 2.6.0 AdminLTE backend theme asset bundle for Yii 2.0 F...
doctrine/annotations v1.6.0 Docblock Annotations Parser
doctrine/instantiator 1.1.0 A small, lightweight utility to instantiate objec...
doctrine/lexer v1.0.1 Base library for a lexer that can be used in Top-...
egulias/email-validator 2.1.3 A library for validating emails against several RFCs
erusev/parsedown 1.6.4 Parser for Markdown.
ezyang/htmlpurifier v4.9.3 Standards compliant HTML filter written in PHP
facebook/webdriver v0.6.0 A php client for WebDriver
fortawesome/font-awesome v4.7.0 The iconic font and CSS framework
fzaninotto/faker v1.7.1 Faker is a PHP library that generates fake data f...
guzzlehttp/guzzle 5.3.2 Guzzle is a PHP HTTP client library and framework...
guzzlehttp/ringphp 1.1.0 Provides a simple API and specification that abst...
guzzlehttp/streams 3.0.0 Provides a simple abstraction over streams of data
herrera-io/json 1.0.3 A library for simplifying JSON linting and valida...
herrera-io/phar-update 1.0.3 A library for self-updating Phars.
id5/legba-gii dev-master 10d7461 An extension of gii generator that brings several...
ikimea/browser 1.12.0 Detecting the user’s browser
jms/metadata 1.6.0 Class/method/property metadata management in PHP
jms/parser-lib 1.0.0 A library for easily creating recursive-descent p...
jms/serializer 1.11.0 Library for (de-)serializing data of any complexi...
justinrainbow/json-schema 1.6.1 A library to validate a json schema.
kartik-v/dependent-dropdown dev-master 1349e7f A multi level dependent dropdown JQuery plugin th...
kartik-v/yii2-detail-view v1.7.6 Various enhancements to the Yii 2 Detail View wit...
kartik-v/yii2-dialog v1.0.3 An asset bundle for bootstrap3-dialog for Yii 2.0...
kartik-v/yii2-grid v3.1.7 Yii 2 GridView on steroids. Various enhancements ...
kartik-v/yii2-helpers v1.3.6 A collection of useful helper functions for Yii F...
kartik-v/yii2-krajee-base v1.8.9 Base library and foundation components for all Yi...
kartik-v/yii2-money v1.2.2 An advanced money mask input for Yii 2.0 based on...
kartik-v/yii2-widget-activeform v1.4.8 Enhanced Yii2 active-form and active-field with f...
kartik-v/yii2-widget-depdrop v1.0.4 Widget that enables setting up dependent dropdown...
kartik-v/yii2-widget-select2 v2.1.1 Enhanced Yii2 wrapper for the Select2 jQuery plug...
kherge/version 1.0.1 A parsing and comparison library for semantic ver...
mobiledetect/mobiledetectlib 2.8.30 Mobile_Detect is a lightweight PHP class for dete...
monolog/monolog 1.23.0 Sends your logs to files, sockets, inboxes, datab...
nikic/php-parser v1.4.1 A PHP parser written in PHP
phpcollection/phpcollection 0.5.0 General-Purpose Collection Library for PHP
phpdocumentor/fileset 1.0.0 Fileset component for collecting a set of files g...
phpdocumentor/graphviz 1.0.4
phpdocumentor/phpdocumentor v2.9.0 Documentation Generator for PHP
phpdocumentor/reflection 3.0.1 Reflection library to do Static Analysis for PHP ...
phpdocumentor/reflection-docblock 2.0.5
phpoption/phpoption 1.5.0 Option Type for PHP
phpspec/php-diff v1.1.0 A comprehensive library for generating difference...
phpunit/php-code-coverage 2.2.4 Library that provides collection, processing, and...
phpunit/php-file-iterator 1.3.4 FilterIterator implementation that filters files ...
phpunit/php-text-template 1.2.1 Simple template engine.
phpunit/php-timer 1.0.9 Utility class for timing
phpunit/php-token-stream 1.4.12 Wrapper around PHP's tokenizer extension.
phpunit/phpunit 4.3.5 The PHP Unit Testing framework.
phpunit/phpunit-mock-objects 2.3.8 Mock Object library for PHPUnit
pimple/pimple v1.1.1 Pimple is a simple Dependency Injection Container...
psr/container 1.0.0 Common Container Interface (PHP FIG PSR-11)
psr/log 1.0.2 Common interface for logging libraries
react/promise v2.5.1 A lightweight implementation of CommonJS Promises...
rmrevin/yii2-fontawesome 2.17.1 Asset Bundle for Yii2 with Font Awesome
sebastian/comparator 1.2.4 Provides the functionality to compare PHP values ...
sebastian/diff 1.4.3 Diff implementation
sebastian/environment 1.3.8 Provides functionality to handle HHVM/PHP environ...
sebastian/exporter 1.2.2 Provides the functionality to export PHP variable...
sebastian/recursion-context 1.0.5 Provides functionality to recursively process PHP...
sebastian/version 1.0.6 Library that helps with managing the version numb...
seld/jsonlint 1.7.1 JSON Linter
swiftmailer/swiftmailer v6.0.2 Swiftmailer, free feature-rich PHP mailer
symfony/browser-kit v2.8.34 Symfony BrowserKit Component
symfony/config v2.8.34 Symfony Config Component
symfony/console v2.8.34 Symfony Console Component
symfony/css-selector v2.6.13 Symfony CssSelector Component
symfony/debug v3.0.9 Symfony Debug Component
symfony/dom-crawler v2.6.13 Symfony DomCrawler Component
symfony/event-dispatcher v2.8.34 Symfony EventDispatcher Component
symfony/filesystem v3.0.9 Symfony Filesystem Component
symfony/finder v2.8.34 Symfony Finder Component
symfony/polyfill-mbstring v1.7.0 Symfony polyfill for the Mbstring extension
symfony/process v2.8.34 Symfony Process Component
symfony/stopwatch v2.8.34 Symfony Stopwatch Component
symfony/translation v3.0.9 Symfony Translation Component
symfony/validator v2.8.34 Symfony Validator Component
symfony/yaml v2.8.34 Symfony Yaml Component
thiagotalma/yii2-fullcalendar 2.0.0 Widget for Yii Framework 2.0 to use FullCalendar
twig/twig v1.35.0 Twig, the flexible, fast, and secure template lan...
wbraganca/yii2-dynamicform dev-master f25adef It is widget to yii2 framework to clone form elem...
webvimark/bootstrap-switch 1.0.0 BootstrapSwitch extension for yii 2
webvimark/components 1.0.3 Components for yii 2
webvimark/date-range-picker 1.0.2 dangrossman daterangepicker yii 2 gridview
webvimark/grid-bulk-actions 1.0.2 Bulk actions extension for yii 2 gridview
webvimark/grid-page-size 1.0.2 Grid page size extension for yii 2 gridview
webvimark/helpers 1.1.0 Helpers for yii 2
webvimark/image 1.0.0 Kohana image lib wrapper for yii 2
webvimark/module-user-management dev-websad c75e3da User with improved RBAC
yiisoft/yii2 2.0.14 Yii PHP Framework Version 2
yiisoft/yii2-bootstrap 2.0.8 The Twitter Bootstrap extension for the Yii frame...
yiisoft/yii2-codeception 2.0.6 The Codeception integration for the Yii framework
yiisoft/yii2-composer 2.0.5 The composer plugin for Yii extension installer
yiisoft/yii2-debug 2.0.13 The debugger extension for the Yii framework
yiisoft/yii2-faker 2.0.3 Fixture generator. The Faker integration for the ...
yiisoft/yii2-gii 2.0.6 The Gii extension for the Yii framework
yiisoft/yii2-jui 2.0.7 The Jquery UI extension for the Yii framework
yiisoft/yii2-swiftmailer 2.1.0 The SwiftMailer integration for the Yii framework
zendframework/zend-cache 2.7.2 provides a generic way to cache any data
zendframework/zend-config 2.6.0 provides a nested object property based user inte...
zendframework/zend-eventmanager 3.2.0 Trigger and listen to events within a PHP applica...
zendframework/zend-filter 2.7.2 provides a set of commonly needed data filters
zendframework/zend-hydrator 1.1.0
zendframework/zend-i18n 2.7.4
zendframework/zend-json 3.1.0 provides convenience methods for serializing nati...
zendframework/zend-serializer 2.8.1 provides an adapter based interface to simply gen...
zendframework/zend-servicemanager 2.7.10
zendframework/zend-stdlib 2.7.7
zetacomponents/base 1.9.1 The Base package provides the basic infrastructur...
zetacomponents/document 1.3.1 The Document components provides a general conver...

  • Suite configuration:
#api.suit.yml
class_name: ApiTester
modules:
    enabled:
        - REST:
            # url: /api
            part: Json
            # depends: PhpBrowser
            depends: Yii2
        - \ApiBundle\Helper\Api
    config:
        - Yii2
  • Structure
tests/
β”œβ”€β”€ acceptance
β”‚   β”œβ”€β”€ AcceptanceTester.php
β”‚   β”œβ”€β”€ _bootstrap.php
β”‚   └── CreateClienteCest.php
β”œβ”€β”€ acceptance.suite.yml
β”œβ”€β”€ api
β”‚   β”œβ”€β”€ _bootstrap.php
β”‚   └── UserLoginCept.php
β”œβ”€β”€ api.suite.yml
β”œβ”€β”€ _bootstrap.php
β”œβ”€β”€ codeception
β”‚   β”œβ”€β”€ acceptance
β”‚   β”‚   β”œβ”€β”€ AcceptanceTester.php
β”‚   β”‚   └── _bootstrap.php
β”‚   β”œβ”€β”€ acceptance.suite.yml
β”‚   β”œβ”€β”€ bin
β”‚   β”‚   β”œβ”€β”€ _bootstrap.php
β”‚   β”‚   β”œβ”€β”€ yii
β”‚   β”‚   └── yii.bat
β”‚   β”œβ”€β”€ _bootstrap.php
β”‚   β”œβ”€β”€ config
β”‚   β”‚   β”œβ”€β”€ acceptance.php
β”‚   β”‚   β”œβ”€β”€ config.php
β”‚   β”‚   β”œβ”€β”€ functional.php
β”‚   β”‚   └── unit.php
β”‚   β”œβ”€β”€ fixtures
β”‚   β”œβ”€β”€ functional
β”‚   β”‚   β”œβ”€β”€ _bootstrap.php
β”‚   β”‚   β”œβ”€β”€ FunctionalTester.php
β”‚   β”‚   β”œβ”€β”€ LoginCept.php
β”‚   β”‚   └── SolicitacaoCept.php
β”‚   β”œβ”€β”€ functional.suite.yml
β”‚   β”œβ”€β”€ _output
β”‚   β”œβ”€β”€ _pages
β”‚   β”‚   β”œβ”€β”€ LoginPage.php
β”‚   β”‚   └── SolicitacaoPage.php
β”‚   β”œβ”€β”€ templates
β”‚   β”œβ”€β”€ unit
β”‚   β”‚   β”œβ”€β”€ _bootstrap.php
β”‚   β”‚   β”œβ”€β”€ fixtures
β”‚   β”‚   β”‚   └── data
β”‚   β”‚   β”œβ”€β”€ models
β”‚   β”‚   β”‚   └── SolicitacaoTest.php
β”‚   β”‚   β”œβ”€β”€ templates
β”‚   β”‚   β”‚   └── fixtures
β”‚   β”‚   └── UnitTester.php
β”‚   └── unit.suite.yml
β”œβ”€β”€ codeception.yml
β”œβ”€β”€ _data
β”‚   └── dump.sql
β”œβ”€β”€ functional
β”‚   β”œβ”€β”€ _bootstrap.php
β”‚   └── FunctionalTester.php
β”œβ”€β”€ functional.suite.yml
β”œβ”€β”€ _output
β”‚   └── CreateClienteCest.tryToTest.fail.html
β”œβ”€β”€ README.md
β”œβ”€β”€ _support
β”‚   β”œβ”€β”€ AcceptanceHelper.php
β”‚   β”œβ”€β”€ ApiHelper.php
β”‚   β”œβ”€β”€ FunctionalHelper.php
β”‚   └── UnitHelper.php
β”œβ”€β”€ unit
β”‚   β”œβ”€β”€ _bootstrap.php
β”‚   └── UnitTester.php
└── unit.suite.yml

Most helpful comment

How did you manage to install Codeception 2.0.9?
Have you got PHPUnit locked to 4.3.5 in composer.json?
The last version of Codeception is 2.3.8 and 2.4.0 will be released soon.

All 3 comments

How did you manage to install Codeception 2.0.9?
Have you got PHPUnit locked to 4.3.5 in composer.json?
The last version of Codeception is 2.3.8 and 2.4.0 will be released soon.

PHPUnit was locked in 4.3.* changed to

"phpunit/phpunit": ">=4.0.0",
"codeception/codeception": ">=2.3.0"

So deleted the following directories

rm -r ./tests
rm -r ./vendor

And

composer install

Run

./vendor/bin/codecept bootstrap
./vendor/bin/codecept build
./vendor/bin/codecept generate:suite api
./vendor/bin/codecept generate:cept api UserLoginCept
./vendor/bin/codecept run -v

Working and solving the problem

Hello, on ./vendor/bin/codecept generate:suite api class ApiTesterActions should be generated in tests/_support/_generatedApiTesterActions ?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gimler picture gimler  Β·  3Comments

simara-svatopluk picture simara-svatopluk  Β·  3Comments

centerax picture centerax  Β·  4Comments

maxibello picture maxibello  Β·  3Comments

DavertMik picture DavertMik  Β·  4Comments