Run the Laravel App for Functional testing

Submitted by Mahmoud_Zalt - 2 years ago

Getting an instance of the Laravel IOC container for testing. ONLY IF THE FUNCTIONAL TEST IS INSIDE A LARAVEL PACKAGE YOU CAN DO THE FOLLOWING: EXTEND THIS FROM YOUR PARENT TEST CLASS.

<?php namespace Vinelab\Youtube\Tests;

class TestCase extends \PHPUnit_Framework_TestCase {

    use ApplicationTrait;


    public function setUp()
    {
        if ( ! $this->app)
        {
            $this->refreshApplication();
        }
    }


}

Ads cover the costs of maintaining Laravel-tricks

comments powered by Disqus

Ads cover the costs of maintaining Laravel-tricks