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()) . ' });'; }
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";
public function testSetClassName() { $direct = new Direct(); $direct->setClassName("Dummy"); $this->assertEquals("Dummy", $direct->getClassName()); }
public function testHasCorrectShortName() { $direct = new Direct([]); $this->assertSame('Direct', $direct->getShortName()); }