Those configuration options might be: - which LibraryHook to use, - where to store cassettes or - which files to scan when filtering source code.
Exemplo n.º 1
0
 public function testHandleRequestRecordsRequest()
 {
     $request = new Request('GET', 'http://example.com', array('User-Agent' => 'Unit-Test'));
     $response = new Response(200, array(), 'example response');
     $client = $this->getClientMock($request, $response);
     $configuration = new Configuration();
     $configuration->enableLibraryHooks(array());
     $proxy = new ProxyBuilder('\\VCR\\Videorecorder');
     $videorecorder = $proxy->setConstructorArgs(array($configuration, $client, VCRFactory::getInstance()))->setProperties(array('cassette', 'client'))->getProxy();
     $videorecorder->client = $client;
     $videorecorder->cassette = $this->getCassetteMock($request, $response);
     $this->assertEquals($response, $videorecorder->handleRequest($request));
 }
Exemplo n.º 2
0
 /**
  * Determines that the provided url is member of a url blacklist.
  *
  * @param string $uri
  *
  * @return bool True if the provided url is blacklisted, flase otherwise.
  */
 protected function isBlacklisted($uri)
 {
     foreach (static::$configuration->getBlackList() as $path) {
         if (strpos($uri, $path) !== false) {
             return true;
         }
     }
     return false;
 }
Exemplo n.º 3
0
 /**
  * Returns a list of callbacks to configured request matchers.
  *
  * @return array List of callbacks to configured request matchers.
  */
 protected function getRequestMatchers()
 {
     return $this->config->getRequestMatchers();
 }