Skip to content

SavvySoftWorksLLC/test_codeception

 
 

Repository files navigation

Laravel PHP Framework with Codeception Testing

To setup

this assumes you already have PHP >= 5.3 and Composer installed

  • laravel new <project name>
  • cd <project name>
Require codeception via composer
  • composer require codeception/codeception --dev
Setup
  • composer exec codecept bootstrap <-- this will create your tests folder and files
Create a testing copy of your .env. file
  • cp .env .env.testing

Function Testing Guide

Unit Testing Guide

Acceptance Testing

This demo uses PhantomJS as the browser for accemptance tests.

It can be installed via download from their website, http://phantomjs.org/ or via brew install phantomjs

Change the browser: in your acceptance.suite.yml to phantomjs

We used the Cest style test in this application, which you can generate with the composer exec codecept generate:cest suitename CestName command.

Example test can be found at tests/acceptance/CancelBtnCest.php

To run the test

Start PhantomJS

  • phantomjs --webdriver=4444 <-- starts phantomjs on port 4444

Run Codeception Test

  • composer exec codecept run tests/acceptance/CancelBtnCest.php

About

The mess that is...

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 93.7%
  • HTML 4.9%
  • Other 1.4%