CodeExplorer preferred example
$this->
assertNotSame($view1,
$view2);
$this->
assertEquals(new ChoiceListView(),
$view1);
$this->
assertEquals(new ChoiceListView(),
$view2);
} public function testCreateViewSamePreferredChoicesUseCache() { $preferred =
['a'
];
$type =
new FormType();
$list =
new ArrayChoiceList([]);
$view1 =
$this->factory->
createView($list, ChoiceList::
preferred($type,
$preferred));
$view2 =
$this->factory->
createView($list, ChoiceList::
preferred($type,
['a'
]));
$this->
assertSame($view1,
$view2);
$this->
assertEquals(new ChoiceListView(),
$view1);
$this->
assertEquals(new ChoiceListView(),
$view2);
} public function testCreateViewDifferentPreferredChoices() { $preferred1 =
['a'
];
$preferred2 =
['b'
];