/** * @param array $data * @param array $expected * * @dataProvider typeChoicesDataProvider */ public function testGetListTypeChoices(array $data, array $expected) { $repository = $this->getMockBuilder('\\Doctrine\\Common\\Persistence\\ObjectRepository')->disableOriginalConstructor()->getMock(); $repository->expects($this->any())->method('findBy')->will($this->returnValue($data)); $om = $this->getMockBuilder('Doctrine\\Common\\Persistence\\ObjectManager')->disableOriginalConstructor()->getMock(); $om->expects($this->any())->method('getRepository')->with($this->equalTo(GridMarketingListTypeProvider::MARKETING_LIST_TYPE))->will($this->returnValue($repository)); $this->registry->expects($this->any())->method('getManagerForClass')->with($this->equalTo(GridMarketingListTypeProvider::MARKETING_LIST_TYPE))->will($this->returnValue($om)); $this->assertEquals($expected, $this->provider->getListTypeChoices()); }
public function testGetListTypeChoices() { $types = $this->provider->getListTypeChoices(); $this->assertInternalType('array', $types); foreach ($types as $name => $label) { $this->assertInternalType('string', $name); $this->assertInternalType('string', $label); } }