34 lines
987 B
PHP
34 lines
987 B
PHP
<?php
|
|
namespace Tests;
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
class TestConfig extends TestCase
|
|
{
|
|
// public function testAppConfig()
|
|
// {
|
|
// $config = config('app');
|
|
// self::assertIsArray($config);
|
|
// self::assertArrayHasKey('debug', $config);
|
|
// self::assertIsBool($config['debug']);
|
|
// self::assertArrayHasKey('default_timezone', $config);
|
|
// self::assertIsString($config['default_timezone']);
|
|
// }
|
|
/**
|
|
* @dataProvider additionProvider
|
|
*/
|
|
public function testAdd($a, $b, $expected)
|
|
{
|
|
// $this->assertSame($expected, $a + $b);
|
|
$this->assertEquals($expected, $a + $b);
|
|
}
|
|
|
|
public function additionProvider()
|
|
{
|
|
return [
|
|
'adding zeros' => [0, 0, 0], // 0 + 0 = 0 pass
|
|
'zero plus one' => [0, 1, 1], // 0 + 1 = 1 pass
|
|
'one plus zero' => [1, 0, 1], // 1 + 0 = 1 pass
|
|
'one plus one' => [1, 1, 2], // 1 + 1 = 2 pass
|
|
];
|
|
}
|
|
} |