Tiny tweaks

This commit is contained in:
Pig Fang 2019-08-15 17:21:55 +08:00
parent f117a4f3c7
commit e67df90978
2 changed files with 3 additions and 8 deletions

View File

@ -41,11 +41,6 @@ class Plugin
return $this->getManifestAttr(Str::snake($name, '-'));
}
public function __isset(string $name)
{
return isset($this->{$name}) || $this->getManifestAttr(Str::snake($name, '-'));
}
public function getManifest()
{
return $this->manifest;

View File

@ -461,12 +461,12 @@ class PluginManagerTest extends TestCase
$this->assertNull(plugin('nope'));
$this->assertInstanceOf(Plugin::class, plugin('fake'));
$this->expectExceptionMessage('No such plugin.');
plugin_assets('nope', 'relative');
$this->assertEquals(
url('plugins').'/fake/assets/relative?v=1',
plugin_assets('fake', 'relative')
);
$this->expectExceptionMessage('No such plugin.');
plugin_assets('nope', 'relative');
}
}