Skip to content
Example CircleCI project using PHP and Laravel
CSS PHP HTML Other
Branch: circleci-2.0
Clone or download
Latest commit 325ba83 Dec 6, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci Standardize composer.lock Oct 10, 2019
app Add tests for application handler functionality Mar 24, 2017
bootstrap Upgrade to Laravel 5.1 Jul 8, 2015
config Update for Laraval 5.4 and remove LaravelCollective dependency Jan 25, 2017
database
homestead @ 69e1e46 Added submodule reference Jun 9, 2016
public Try a lighter version of the auth scaffolding. Jan 9, 2015
resources Update for Laraval 5.4 and remove LaravelCollective dependency Jan 25, 2017
storage Views. Jan 5, 2015
tests Add tests for application handler functionality Mar 24, 2017
.env.example Make use of a testing specific database Jan 27, 2015
.env.testing Make use of a testing specific database Jan 27, 2015
.gitattributes
.gitignore composer.lock Dec 21, 2017
.gitmodules Add Homestead for this project Jun 1, 2016
Homestead.yaml Small tweaks for Vagrant functionality Jun 15, 2016
Vagrantfile Fix path Jun 1, 2016
after.sh Match command from travis Jun 1, 2016
artisan Update for Laravel 5.0 release Feb 5, 2015
codeception.yml Setup code coverage config Jul 8, 2015
composer.json Issue #20 - CVE-2019-10913 and CVE-2019-18888 Dec 3, 2019
composer.lock composer.lock Dec 21, 2017
gulpfile.js updated elixir description in gulpfile from sass to less Jan 22, 2015
package.json Fix alignment Nov 21, 2014
phpspec.yml Add PHPSpec config file and dependency Sep 28, 2014
phpunit.xml
readme.md
server.php Add back in server file. Jan 20, 2015

readme.md

Sample Laravel Application with Codeception tests.

CircleCI

Setup

You can setup this sample manually or use Vagrant to automatically set up a development environment for you.

Manual

  • Clone repo
  • Create your .env file from the example file: cp .env.testing .env
  • Install composer dependencies: composer install
  • Create databases by creating the following files:
    • storage/database.sqlite
    • storage/testing.sqlite
  • Run the following commands:
    • php artisan migrate
    • php artisan migrate --database=sqlite_testing
  • Server: run php -S localhost:8000 -t public
  • Browse to localhost:8000/posts

Vagrant

  • Clone repo
  • Cd into the cloned directory
  • Install git submodules: git submodule update --init --recursive
    • you can also add the --recursive flag to the git clone command to skip this step
  • Run vagrant up

To SSH into the machine to run your tests, run vagrant ssh. You can access the app on the guest VM under http://192.168.10.10/.

To test

Run Codeception, installed via Composer

./vendor/bin/codecept build
./vendor/bin/codecept run

Tests

Please check out some good test examples provided.

Functional Tests

Demonstrates testing of CRUD application with

  • PageObjects
  • authentication (by user, credentials, http auth)
  • usage of session variables
  • routes
  • creating and checking records in database
  • testing of form errors

API Tests

Demonstrates functional testing of API using REST and Laravel5 modules connected, with

  • partial json inclusion in response
  • GET/POST/PUT/DELETE requests
  • check changes inside database
You can’t perform that action at this time.