/** * @dataProvider exceptionDataProvider * * InvalidPropertyException is thrown but caught and returning with a * SMWDIError instead * * @since 1.9 */ public function testInvalidPropertyException($property) { $instance = $this->newInstance($property); $results = $instance->getResults(); $this->assertInternalType('array', $results); $this->assertEquals(1, $instance->getCount()); $this->assertInstanceOf('SMWDIError', $results[0]); $this->assertContains($property, MessageFormatter::newFromArray($this->getLanguage(), array($results[0]->getErrors()))->getHtml()); }
/** * @test MessageFormatter::newFromArray * @test MessageFormatter::setType * @test MessageFormatter::getHtml * @dataProvider getDataProvider * * @since 1.9 * * @param array $messages */ public function testNewFromArray(array $messages) { $instance = MessageFormatter::newFromArray($this->getLanguage(), $messages); $instance->setType('error'); $this->assertInternalType('string', $instance->getHtml()); $instance->setType('warning'); $this->assertInternalType('string', $instance->getHtml()); $instance->setType('info'); $this->assertInternalType('string', $instance->getHtml()); }