Exemplo n.º 1
0
 public function testGetFormatter()
 {
     $testTypeFormatter = new \stdClass();
     $this->setContainerMock('exist_formatter', $testTypeFormatter);
     $this->assertEquals($testTypeFormatter, $this->formatter->getFormatterByAlias('exist_alias'));
     //test already created formatter will be stored in provider
     $this->assertEquals($testTypeFormatter, $this->formatter->getFormatterByAlias('exist_alias'));
     $this->setExpectedException('Oro\\Bundle\\ImportExportBundle\\Exception\\InvalidArgumentException', 'The formatter is not found by "non_exist_alias" alias.');
     $this->formatter->getFormatterByAlias('non_exist_alias');
 }
Exemplo n.º 2
0
 /**
  * @expectedException InvalidArgumentException
  * @expectedExceptionMessage The formatter is not found by "non_exist_alias" alias.
  */
 public function testGetFormatterByAliasWithNotExistsAlias()
 {
     $this->formatter->getFormatterByAlias('non_exist_alias');
 }