Exemplo n.º 1
0
 /**
  * Provides an instance of the ProxyBuilder.
  *
  * @param string $className
  *
  * @return \lapistano\ProxyObject\ProxyBuilder
  */
 public function getProxyBuilderObject($className = '\\lapistano\\Tests\\ProxyObject\\DummyNS')
 {
     $pb = new ProxyBuilder($className);
     return $pb->setMethods(array('getArm', 'getArmNS'));
 }
Exemplo n.º 2
0
 /**
  * @dataProvider codeSnippetProvider
  */
 public function testTransformCode($expected, $code)
 {
     $proxy = new ProxyBuilder('\\VCR\\CodeTransform\\CurlCodeTransform');
     $filter = $proxy->setMethods(array('transformCode'))->getProxy();
     $this->assertEquals($expected, $filter->transformCode($code));
 }
Exemplo n.º 3
0
 /**
  * @covers \lapistano\wsunit\Http\HttpClient::getResponseObject
  */
 public function testGetResponseObject()
 {
     $pb = new ProxyBuilder('\\lapistano\\wsunit\\Http\\HttpClient');
     $client = $pb->setMethods(array('getResponseObject'))->getProxy();
     $this->assertInstanceOf('\\lapistano\\wsunit\\Http\\HttpResponse', $client->getResponseObject());
 }
 public function testProxyMemberOfClassWithNoHiddenMember()
 {
     $proxy = new ProxyBuilder('DummyNoProtectedMembers');
     $proxyDummyNS = $proxy->setMethods(array('getArm'))->getProxy();
     $this->assertEquals('left arm', $proxyDummyNS->getArm('left'));
 }