Download the PHP package divineomega/phantomjs-laravel-testing without Composer
On this page you can find all versions of the php package divineomega/phantomjs-laravel-testing. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download divineomega/phantomjs-laravel-testing
More information about divineomega/phantomjs-laravel-testing
Files in divineomega/phantomjs-laravel-testing
Package phantomjs-laravel-testing
Short Description PhantomJS Laravel Testing
License LGPL-3.0
Homepage https://github.com/DivineOmega/PhantomJS-Laravel-Testing
Informations about the package phantomjs-laravel-testing
PhantomJS Laravel Testing
The PhantomJS Laravel Testing package allows you to easily test your Laravel application's JavaScript functionality. It makes use of the PhantomJS headless browser to emulate how a real use would interact with your pages. If you have done regular Laravel testing, you'll be happy to know that this package attempts to match its syntax as much as possible.
💡 NOTE: If you're starting a new project, I recommend using Laravel Dusk instead. PhantomJS development is being suspended and will likely not receive any future updates.
Features
- Identical syntax to standard Laravel testing code where possible
- PhantomJS-powered headless browser allows full functionality testing, including JavaScript & AJAX
- Makes use of database transactions to prevent testing having permanent effects on the database
- Automated setup and install of all dependencies, including phantomjs binary
Requirements
- Only Laravel 5.1 is currently supported
Installation
- Add composer script
"PhantomInstaller\\Installer::installPhantomJS"
tocomposer.json
post-install-cmd
andpost-update-cmd
arrays. - Install via
composer require divineomega/phantomjs-laravel-testing
. - Add service provider
DivineOmega\PhantomJSLaravelTesting\ServiceProvider::class
toconfig/app.php
providers
array. - Add global middleware
\DivineOmega\PhantomJSLaravelTesting\Http\Middleware\GlobalMiddleware::class
toapp/Http/Kernel.php
middleware
array.
Usage
Simply change your test classes to extend PhantomJSTestCase
instead of TestCase
, then run your unit tests as you normally do. PhantomJS will
automatically be started up when required.
An example test case is shown below.
All versions of phantomjs-laravel-testing with dependencies
facebook/webdriver Version ^1.2
phpunit/phpunit Version ~4.0
jakoch/phantomjs-installer Version 2.1.1-p08