Exemplo n.º 1
0
 public function testGetRelations()
 {
     // directional case is covered by testAddRelation()
     // inverse
     $model = new \Magento\Framework\Data\Graph([1, 2, 3], [[1, 2], [2, 3]]);
     $this->assertEquals([2 => [1 => 1], 3 => [2 => 2]], $model->getRelations(\Magento\Framework\Data\Graph::INVERSE));
     // non-directional
     $this->assertEquals([1 => [2 => 2], 2 => [1 => 1, 3 => 3], 3 => [2 => 2]], $model->getRelations(\Magento\Framework\Data\Graph::NON_DIRECTIONAL));
 }
Exemplo n.º 2
0
 public function testGetRelations()
 {
     // directional case is covered by testAddRelation()
     // inverse
     $model = new \Magento\Framework\Data\Graph(array(1, 2, 3), array(array(1, 2), array(2, 3)));
     $this->assertEquals(array(2 => array(1 => 1), 3 => array(2 => 2)), $model->getRelations(\Magento\Framework\Data\Graph::INVERSE));
     // non-directional
     $this->assertEquals(array(1 => array(2 => 2), 2 => array(1 => 1, 3 => 3), 3 => array(2 => 2)), $model->getRelations(\Magento\Framework\Data\Graph::NON_DIRECTIONAL));
 }