for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Part of SplTypes package.
*
* (c) Adrien Loyant <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Ducks\Component\SplTypes\Tests\phpunit;
use Ducks\Component\SplTypes\SplBool as DuckBool;
use PHPUnit\Framework\TestCase;
class SplBoolTest extends TestCase
{
* Unit test.
* @return void
public function test(): void
$instance = new DuckBool();
$this->assertFalse($instance());
$instance = new DuckBool(true);
$this->assertTrue($instance());
}
public function testGetConstList(): void
$list = [
'__default' => false,
'false' => false,
'true' => true,
];
$test = $instance->getConstList(true);
$this->assertSame($list, $test);
$test = $instance->getConstList();
unset($list['__default']);
public function testSerialization(): void
$serialized = \serialize($instance);
$unserialized = \unserialize($serialized);
$this->assertEquals($instance, $unserialized);