1. Go to this page and download the library: Download styde/enlighten library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
namespace Tests;
use Styde\Enlighten\Tests\EnlightenSetup;
class TestCase extends \Tests\TestCase
{
use EnlightenSetup;
protected function setUp(): void
{
parent::setUp();
$this->setUpEnlighten();
}
}
[
'tests' => [
// Add expressions to ignore test class names and test method names.
// i.e. Tests\Unit\* ignores all tests in the Tests\Unit\ suite,
// validates_* ignores all tests that start with validates_.
'ignore' => [
'method_that_will_be_ignored',
],
],
];
/**
* @enlighten {"ignore": true}
*/
class IgnoreClassWithAnnotationTest extends TestCase
{
use RefreshDatabase;
/**
* @test
* @enlighten {"ignore": true}
*/
function does_not_export_test_methods_with_the_enlighten_ignore_annotation()
{
$this->assertExampleIsNotCreated();
}
}
/**
* @title User Module
*
* or if you prefer:
*
* @testdox User Module
*
* and you can also use:
*
* @description Manage all the user-related petitions.
**/
class UsersTest extends TestCase {
/**
*
* @testdox Create Users
*
* @description Register a new user via POST request. API credentials must be provided.
**/
public function testRegisterNewUsers()
{
$this->assertTrue(true);
}
}
// config/enlighten.php
return [
// Add values to this array if you want to hide certain sections from your views.
// For valid sections see \Styde\Enlighten\Section
'hide' => [
//
],
];
use Styde\Enlighten\Facades\Settings;
class CalcTest extends TestCase
{
/**
* @test
* @testdox Sum two numbers
* @description Use the Calc `sum` static method to sum two numbers.
**/
public function can_sum_two_numbers()
{
$result = Settings::test(function () {
$a = 1;
$b = 2;
return Calc::sum($a, $b);
});
$this->assertSame(3, $result);
}
}