public function isLoaded($failMessage = null)
{
$extension = call_user_func($this->phpExtensionFactory, $this->valueIsSet()->name);
try {
$extension->requireExtension();
$this->pass();
} catch (atoum\php\exception $exception) {
$this->fail($failMessage ?: $this->_('PHP extension \'%s\' is not loaded', $this));
}
return $this;
}
public function testIsLoaded() { $this->if($asserter = new sut(new asserter\generator()))->then->exception(function () use($asserter) { $asserter->isLoaded(); })->isInstanceOf('mageekguy\\atoum\\exceptions\\logic')->hasMessage('Name of PHP extension is undefined')->if($asserter->setAdapter($adapter = new atoum\test\adapter()))->and($adapter->extension_loaded = false)->and($asserter->setWith($extensionName = uniqid()))->then->exception(function () use($asserter) { $asserter->isLoaded(); })->isInstanceOf('mageekguy\\atoum\\test\\exceptions\\skip')->hasMessage('PHP extension \'' . $extensionName . '\' is not loaded')->if($adapter->extension_loaded = true)->then->object($asserter->isLoaded())->isIdenticalTo($asserter); }