@runInSeparateProcess

@runInSeparateProcess

Indicates that a test should be run in a separate PHP process.

use PHPUnit\Framework\TestCase;

class MyTest extends TestCase
{
    /**
     * @runInSeparateProcess
     */
    public function testInSeparateProcess()
    {
        // ...
    }
}

Note: By default, PHPUnit will attempt to preserve the global state from the parent process by serializing all globals in the parent process and unserializing them in the child process. This can cause problems if the parent process contains globals that are not serializable. See the section called “@preserveGlobalState” for information on how to fix this.

doc_PHPUnit
2016-10-16 15:37:31
Comments
Leave a Comment

Please login to continue.