Skip to content

Instantly share code, notes, and snippets.

@lavandosovich
Last active May 26, 2017 23:45
Show Gist options
  • Select an option

  • Save lavandosovich/b369f4a72b3e55c7b3e211e53b714437 to your computer and use it in GitHub Desktop.

Select an option

Save lavandosovich/b369f4a72b3e55c7b3e211e53b714437 to your computer and use it in GitHub Desktop.
Codeception

Working codecept command

  • sudo composer global require codeception/codeception
  • sudo ln -s ~/.composer/vendor/bin/codecept /usr/local/bin/codecept

Codeception Installation

  • sudo apt-get install php7.1-curl php7.1-mbstring if in demand

  • composer require "codeception/codeception"

  • alias codecept='./vendor/bin/codecept' or

    , if in symfony app folder,

    alias codecept='php vendor/codeception/codeception/codecept'

  • codecept

Installation for Symfony project

  • add "codeception/codeception": "2.*" to composer.json require-dev
  • sudo composer update - updates composer.lock
  • php vendor/codeception/codeception/codecept bootstrap - this inits app with codeception

Test of all shapes

  • php vendor/codeception/codeception/codecept g:phpunit unit Phpunit
  • php vendor/codeception/codeception/codecept g:test unit CodeceptionPhpunit
  • php vendor/codeception/codeception/codecept g:cept functional Functional
  • php vendor/codeception/codeception/codecept g:cest acceptance Accept

Run tests

  • Be sure that suits configured well
  • Check parameters.yml for a apropriate settings
  • Run server php bin/console server:run
  • codecept run

Tutorial with Symfony 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment