Example #1
0
 function get(Direct $direct, Service $service)
 {
     header('Content-type: text/javascript');
     echo 'Ext.Direct.addProvider({
         type: "remoting",
         url: "' . $direct->getUrl() . '",
         actions: ' . json_encode($service->getActions()) . '
     });';
 }
Example #2
0
trait TestTraitIndirect
{
    use TestTrait;
}
class Indirect
{
    use TestTraitIndirect;
}
function test()
{
    return "__TRAIT__: <" . __TRAIT__ . "> __CLASS__: <" . __CLASS__ . "> __METHOD__: <" . __METHOD__ . ">";
}
class NoTraitUsed
{
    public static function test()
    {
        return "__TRAIT__: <" . __TRAIT__ . "> __CLASS__: <" . __CLASS__ . "> __METHOD__: <" . __METHOD__ . ">";
    }
}
trait TestTrait
{
    public static function test()
    {
        return "__TRAIT__: <" . __TRAIT__ . "> __CLASS__: <" . __CLASS__ . "> __METHOD__: <" . __METHOD__ . ">";
    }
}
echo Direct::test() . "\n";
echo IndirectInheritance::test() . "\n";
echo Indirect::test() . "\n";
echo NoTraitUsed::test() . "\n";
echo test() . "\n";
Example #3
0
 public function testSetClassName()
 {
     $direct = new Direct();
     $direct->setClassName("Dummy");
     $this->assertEquals("Dummy", $direct->getClassName());
 }
Example #4
0
 public function testHasCorrectShortName()
 {
     $direct = new Direct([]);
     $this->assertSame('Direct', $direct->getShortName());
 }