for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Tests;
use PHPUnit\Framework\TestCase;
class HelpersTest extends TestCase
{
/**
* Includes the functions file manually.
*
* @return void
*/
public function setUp()
require_once __DIR__ . '/../app/helpers.php';
}
* Tests the view importer.
public function testView(): void
$hash = bin2hex(openssl_random_pseudo_bytes(16));
$value = view('/../tests/samples/view.php', ['hash' => $hash]);
$value
view('/../tests/samples/...array('hash' => $hash))
This check looks for function or method calls that always return null and whose return value is assigned to a variable.
class A { function getObject() { return null; } } $a = new A(); $object = $a->getObject();
The method getObject() can return nothing but null, so it makes no sense to assign that value to a variable.
getObject()
The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.
$this->assertEquals('Test value: ' . $hash, $value);
* tests the configuration importer.
public function testConfig(): void
$hash = '9575d687c61ce66fc190cd2bed464cef';
$value = config('tests/samples/config.php');
$this->assertEquals($hash, $value['api_secret']);
This check looks for function or method calls that always return null and whose return value is assigned to a variable.
The method
getObject()
can return nothing but null, so it makes no sense to assign that value to a variable.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.