[ Index ]

PHP Cross Reference of phpBB-3.2.11-deutsch

title

Body

[close]

/vendor/ocramius/proxy-manager/tests/language-feature-scripts/ -> remote-object-json-adapter-denies-unknow-method.phpt (source)

   1  --TEST--
   2  Verifies that generated remote object can call public property
   3  --FILE--
   4  <?php
   5  
   6  require_once  __DIR__ . '/init.php';
   7  
   8  use ProxyManager\Factory\RemoteObject\AdapterInterface;
   9  use Zend\Json\Server\Client;
  10  
  11  interface FooServiceInterface
  12  {
  13      public function foo();
  14  }
  15  
  16  class Foo implements FooServiceInterface
  17  {
  18      public $foo = "baz";
  19      
  20      public function foo()
  21      {
  22          return 'bar';
  23      }
  24  }
  25  
  26  class CustomAdapter implements AdapterInterface
  27  {
  28      public function call($wrappedClass, $method, array $params = array())
  29      {
  30          return 'baz';
  31      }
  32  }
  33  
  34  $factory = new \ProxyManager\Factory\RemoteObjectFactory(new CustomAdapter(), $configuration);
  35  $proxy   = $factory->createProxy('ProxyManagerTestAsset\RemoteProxy\FooServiceInterface');
  36  
  37  var_dump($proxy->foo());
  38  var_dump($proxy->unknown());
  39  ?>
  40  --EXPECTF--
  41  string(3) "baz"
  42  
  43  %SFatal error: Call to undefined method %s::unknown%S in %s on line %d


Generated: Wed Nov 11 20:33:01 2020 Cross-referenced by PHPXref 0.7.1