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\SplString as DuckString;
use PHPUnit\Framework\TestCase;
class SplStringTest extends TestCase
{
* Unit test.
* @return void
public function test(): void
$instance = new DuckString();
$this->assertSame('', $instance());
$instance = new DuckString('hello world');
$this->assertSame('hello world', $instance());
}
* @psalm-suppress UnsupportedReferenceUsage
public function testConcatenate(): void
$instance = new DuckString('hello ');
$value = &$instance();
$value .= 'world';
$this->assertSame('hello world', $value);
public function testSerialization(): void
$serialized = \serialize($instance);
$unserialized = \unserialize($serialized);
$this->assertEquals($instance, $unserialized);