Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
RuntimeTest.php
Go to the documentation of this file.
1 <?php
8 
9 require_once __DIR__ . '/../_files/Child.php';
10 
11 class RuntimeTest extends \PHPUnit\Framework\TestCase
12 {
16  private $model;
17 
18  protected function setUp()
19  {
20  $this->model = new \Magento\Framework\ObjectManager\Relations\Runtime();
21  }
22 
28  public function testGetParents($type, $parents)
29  {
30  $this->assertEquals($parents, $this->model->getParents($type));
31  }
32 
36  public function getParentsDataProvider()
37  {
38  return [
39  [\Magento\Test\Di\DiInterface::class, []],
40  [\Magento\Test\Di\DiParent::class, [null, \Magento\Test\Di\DiInterface::class]],
41  [\Magento\Test\Di\Child::class, [\Magento\Test\Di\DiParent::class, \Magento\Test\Di\ChildInterface::class]]
42  ];
43  }
44 
48  public function testHasIfNonExists()
49  {
50  $this->assertFalse($this->model->has(\NonexistentClass::class));
51  }
52 }
defined('TESTS_BP')||define('TESTS_BP' __DIR__
Definition: _bootstrap.php:60
$type
Definition: item.phtml:13