StringTest::testLengthPreservation PHP Method

testLengthPreservation() public method

    public function testLengthPreservation()
    {
        $this->forAll(Generator\string(), Generator\string())->then(function ($first, $second) {
            $result = string_concatenation($first, $second);
            $this->assertEquals(strlen($first) + strlen($second), strlen($result), "Concatenating '{$first}' to '{$second}' gives '{$result}'" . PHP_EOL . var_export($first, true) . PHP_EOL . "strlen(): " . strlen($first) . PHP_EOL . var_export($second, true) . PHP_EOL . "strlen(): " . strlen($second) . PHP_EOL . var_export($result, true) . PHP_EOL . "strlen(): " . strlen($result) . PHP_EOL . "First hex: " . var_export(bin2hex($first), true) . PHP_EOL . "Second hex: " . var_export(bin2hex($second), true) . PHP_EOL . "Result hex: " . var_export(bin2hex($result), true) . PHP_EOL);
        });
    }