MathPHP\SetTheory\SetOperationsTest::testUnionWithArrays PHP Метод

testUnionWithArrays() публичный Метод

public testUnionWithArrays ( )
    public function testUnionWithArrays()
    {
        $A = new Set([1, 2, [1, 2, 3]]);
        $B = new Set([2, 3, [2, 3, 4]]);
        $A∪B = $A->union($B);
        $expected = new Set([1, 2, [1, 2, 3], 3, [2, 3, 4]]);
        $this->assertEquals($expected, $A∪B);
        $this->assertEquals($expected->asArray(), $A∪B->asArray());
        $A = new Set([1, 2, [1, 2, 3]]);
        $B = new Set([2, 3, [2, 3, 4], [1, 2, 3]]);
        $A∪B = $A->union($B);
        $expected = new Set([1, 2, [1, 2, 3], 3, [2, 3, 4]]);
        $this->assertEquals($expected, $A∪B);
        $this->assertEquals($expected->asArray(), $A∪B->asArray());
    }