public function testOnApi()
{
$document = new Document(null, null, Document::TYPE_API);
$document->setPath('foobar.html');
$event = new CarewEvent($document);
$extraction = new Optimization();
$extraction->onDocument($event);
$this->assertSame('api/foobar.html', $document->getPath());
}