mirror of
https://github.com/ivuorinen/bbcodeparser.git
synced 2026-01-30 16:41:28 +00:00
Initial commit with tests, and stuff.
This commit is contained in:
34
tests/BBCodeParserFacadeTest.php
Normal file
34
tests/BBCodeParserFacadeTest.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
class BBCodeParserFacadeTest extends TestCase
|
||||
{
|
||||
public function test_facade_exists_and_has_bbcode()
|
||||
{
|
||||
try {
|
||||
$method = $this->callMethod(
|
||||
new \ivuorinen\BBCode\Facades\BBCodeParser,
|
||||
'getFacadeAccessor',
|
||||
[]
|
||||
);
|
||||
$this->assertEquals('bbcode', $method);
|
||||
} catch (ReflectionException $e) {
|
||||
$this->throwException($e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $obj
|
||||
* @param $name
|
||||
* @param array $args
|
||||
* @return mixed
|
||||
* @throws ReflectionException
|
||||
*/
|
||||
public static function callMethod($obj, $name, array $args)
|
||||
{
|
||||
$class = new \ReflectionClass($obj);
|
||||
$method = $class->getMethod($name);
|
||||
$method->setAccessible(true);
|
||||
return $method->invokeArgs($obj, $args);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user