MathPHP\SetTheory\SetOperationsTest::testDifferenceWithArrays PHP Method

testDifferenceWithArrays() public method

    public function testDifferenceWithArrays()
    {
        $A = new Set([1, 2, [1, 2, 3]]);
        $B = new Set([2, 3, [2, 3, 4]]);
        $A∖B = $A->difference($B);
        $expected = new Set([1, [1, 2, 3]]);
        $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->difference($B);
        $expected = new Set([1]);
        $this->assertEquals($expected, $A∖B);
        $this->assertEquals($expected->asArray(), $A∖B->asArray());
    }