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

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

So each array element will be added, but with the implementation detail that they will be converted into ArrayObjects.
    public function testAddMultiWithArrayOfArrays()
    {
        $set = new Set([1, 2, 3]);
        $array = [4, 5, [1, 2, 3]];
        $set->addMulti($array);
        $this->assertEquals(6, count($set));
        $this->assertEquals(6, count($set->asArray()));
        $arrays = 0;
        foreach ($set as $key => $value) {
            if (is_array($value)) {
                $arrays++;
                $this->assertEquals([1, 2, 3], $value);
                $this->assertEquals(3, count($value));
                $this->assertEquals(1, $value[0]);
                $this->assertEquals(1, $value[0]);
                $this->assertEquals(1, $value[0]);
            }
        }
        // There should have only been one array.
        $this->assertEquals(1, $arrays);
    }