PhpBench\Tests\Unit\Formatter\FormatterTest::testInvalidFormatOptions PHP Метод

testInvalidFormatOptions() публичный Метод

It should throw an exception if invalid options are given for a formatter.
    public function testInvalidFormatOptions()
    {
        $this->registry->get('formatter_1')->willReturn($this->format->reveal());
        $this->formatter->registerClasses(['one' => [['formatter_1', ['not_known' => 'value_1']]]]);
        $this->format->getDefaultOptions()->willReturn(['foobar' => 'barfoo']);
        try {
            $this->formatter->applyClasses(['one'], 'hello world');
        } catch (\InvalidArgumentException $e) {
            $this->assertNotNull($e->getPrevious());
            $this->assertEquals('Invalid options "not_known" for format "formatter_1", valid options: "foobar"', $e->getPrevious()->getMessage());
        }
    }