/** * Tests the factory method on the collection * @param string|int $index * @param mixed $value * @param bool $valid * * @dataProvider factoryProvider */ public function testFactory($index, $value, $valid = true) { $event = Collection::factory($index, $value); if ($valid) { $this->assertInstanceOf('Nimbles\\Core\\Event', $event); $this->assertEquals($index, $event->getName()); } else { $this->assertNull($event); } }