예제 #1
0
파일: Controller.php 프로젝트: cti/direct
 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()) . '
     });';
 }
예제 #2
0
파일: 1990.php 프로젝트: badlamer/hhvm
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";
예제 #3
0
 public function testSetClassName()
 {
     $direct = new Direct();
     $direct->setClassName("Dummy");
     $this->assertEquals("Dummy", $direct->getClassName());
 }
예제 #4
0
 public function testHasCorrectShortName()
 {
     $direct = new Direct([]);
     $this->assertSame('Direct', $direct->getShortName());
 }