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

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

public testCartesianProduct ( array $A, array $B, array $A×B, Set $R )
$A array
$B array
$A×B array
$R Set
    public function testCartesianProduct(array $A, array $B, array $A×B, Set $R)
    {
        $setA = new Set($A);
        $setB = new Set($B);
        $setA×B = $setA->cartesianProduct($setB);
        $A×B_array = $setA×B->asArray();
        $this->assertEquals($R, $setA×B);
        $this->assertEquals($A×B, $A×B_array);
        $this->assertEquals(count($setA×B), count($A×B));
        foreach ($setA×B as $key => $value) {
            $this->assertInstanceOf('MathPHP\\SetTheory\\Set', $value);
            $this->assertEquals(2, count($value));
        }
        foreach ($A×B_array as $key => $value) {
            $this->assertInstanceOf('MathPHP\\SetTheory\\Set', $value);
            $this->assertEquals(2, count($value));
        }
    }