Overview

Namespaces

  • Composer
    • Autoload
  • Guzzle
    • Common
      • Exception
    • Http
      • Curl
      • Exception
      • Message
        • Header
      • QueryAggregator
    • Parser
      • Cookie
      • Message
      • UriTemplate
      • Url
    • Plugin
      • Mock
    • Stream
  • Mockery
    • Adapter
      • Phpunit
    • CountValidator
    • Exception
    • Generator
      • StringManipulation
        • Pass
    • Loader
    • Matcher
  • None
  • Omnipay
    • Common
      • Exception
      • Message
    • Dummy
      • Message
    • Fatzebra
      • Message
  • PHP
  • Symfony
    • Component
      • EventDispatcher
        • Debug
        • DependencyInjection
        • Tests
          • Debug
          • DependencyInjection
      • HttpFoundation
        • File
          • Exception
          • MimeType
        • Session
          • Attribute
          • Flash
          • Storage
            • Handler
            • Proxy
        • Tests
          • File
            • MimeType
          • Session
            • Attribute
            • Flash
            • Storage
              • Handler
              • Proxy
      • Yaml
        • Exception
        • Tests

Classes

  • Symfony\Component\Yaml\Tests\A
  • Symfony\Component\Yaml\Tests\B
  • Symfony\Component\Yaml\Tests\DumperTest
  • Symfony\Component\Yaml\Tests\InlineTest
  • Symfony\Component\Yaml\Tests\ParseExceptionTest
  • Symfony\Component\Yaml\Tests\ParserTest
  • Symfony\Component\Yaml\Tests\YamlTest
  • Overview
  • Namespace
  • Function
  • Tree
 1: <?php
 2: 
 3: namespace Mockery\Generator\StringManipulation\Pass;
 4: 
 5: use Mockery\Generator\MockConfiguration;
 6: 
 7: class InstanceMockPass
 8: {
 9:     const INSTANCE_MOCK_CODE = <<<MOCK
10: 
11:     protected \$_mockery_ignoreVerification = true;
12: 
13:     public function __construct()
14:     {
15:         \$this->_mockery_ignoreVerification = false;
16:         \$associatedRealObject = \Mockery::fetchMock(__CLASS__);
17:         \$directors = \$associatedRealObject->mockery_getExpectations();
18:         foreach (\$directors as \$method=>\$director) {
19:             \$expectations = \$director->getExpectations();
20:             // get the director method needed
21:             \$existingDirector = \$this->mockery_getExpectationsFor(\$method);
22:             if (!\$existingDirector) {
23:                 \$existingDirector = new \Mockery\ExpectationDirector(\$method, \$this);
24:                 \$this->mockery_setExpectationsFor(\$method, \$existingDirector);
25:             }
26:             foreach (\$expectations as \$expectation) {
27:                 \$clonedExpectation = clone \$expectation;
28:                 \$existingDirector->addExpectation(\$clonedExpectation);
29:             }
30:         }
31:         \Mockery::getContainer()->rememberMock(\$this);
32:     }
33: MOCK;
34: 
35:     public function apply($code, MockConfiguration $config)
36:     {
37:         if ($config->isInstanceMock()) {
38:             $code = $this->appendToClass($code, static::INSTANCE_MOCK_CODE);
39:         }
40: 
41:         return $code;
42:     }
43: 
44:     protected function appendToClass($class, $code)
45:     {
46:         $lastBrace = strrpos($class, "}");
47:         $class = substr($class, 0, $lastBrace) . $code . "\n    }\n";
48:         return $class;
49:     }
50: }
51: 
Omnipay Fat Zebra / Paystream Gateway Module API Documentation API documentation generated by ApiGen