Scalr\Tests\Service\AwsTestCase::getAwsMock PHP Method

getAwsMock() public method

Gets an Aws mock
public getAwsMock ( ) : Aws
return Scalr\Service\Aws Returns Aws Mock stub
    public function getAwsMock()
    {
        $container = $this->getContainer();
        $awsStub = $this->getMock(AwsTestCase::AWS_NS, array('__get', 'getEntityManager', 'getContainer'), array(AwsTestCase::REGION), '', false);
        $em = new EntityManager();
        $awsStub->expects($this->any())->method('getEntityManager')->will($this->returnValue($em));
        $awsStub->expects($this->any())->method('getContainer')->will($this->returnValue($container));
        foreach (array('region' => self::REGION, 'accessKeyId' => $container->initialized('environment') ? $container->awsAccessKeyId : 'fakeAccessKeyId', 'secretAccessKey' => $container->initialized('environment') ? $container->awsSecretAccessKey : 'fakeAwsSecretAccessKey') as $k => $v) {
            $r = new \ReflectionProperty(AwsTestCase::AWS_NS, 'region');
            $r->setAccessible(true);
            $r->setValue($awsStub, self::REGION);
            $r->setAccessible(false);
            unset($r);
        }
        return $awsStub;
    }