Inheritance: extends PHPUnit_Framework_TestCase
コード例 #1
0
 /**
  * @inheritdoc
  */
 protected function setUp()
 {
     parent::setUp();
     $this->domains = $this->getMockBuilder(Domains::class)->disableOriginalConstructor()->getMock();
     $this->environment->method('getDomains')->willReturn($this->domains);
     $this->domain = $this->getMockBuilder(Domain::class)->disableOriginalConstructor()->getMock();
 }
コード例 #2
0
 /**
  * @inheritdoc
  */
 public function setUp()
 {
     parent::setUp();
     $this->command = new RemoveCommand();
     $this->command->setSites($this->sites);
     $this->command->setLogger($this->logger);
 }
コード例 #3
0
 /**
  * @inheritdoc
  */
 protected function setup()
 {
     parent::setUp();
     $this->command = new FilesCommand($this->getConfig());
     $this->command->setSites($this->sites);
     $this->command->setLogger($this->logger);
 }
コード例 #4
0
 /**
  * @inheritdoc
  */
 protected function setup()
 {
     parent::setUp();
     $this->command = new InfoCommand($this->getConfig());
     // use the basic mocked sites from CommandTestCase
     $this->command->setSites($this->sites);
 }
コード例 #5
0
 protected function setUp()
 {
     parent::setUp();
     $this->command = new DummyCommand($this->getConfig());
     $this->command->setSites($this->sites);
     $this->command->setLogger($this->logger);
     $this->site->expects($this->any())->method('get')->withConsecutive([$this->equalTo('framework')], [$this->equalTo('name')])->willReturnOnConsecutiveCalls('framework-a', 'site');
 }
コード例 #6
0
 /**
  * @inheritdoc
  */
 protected function setUp()
 {
     parent::setUp();
     $this->backups = $this->getMockBuilder(Backups::class)->disableOriginalConstructor()->getMock();
     $this->environment->method('getBackups')->willReturn($this->backups);
     $this->backup = $this->getMockBuilder(Backup::class)->disableOriginalConstructor()->getMock();
     $this->workflow = $this->getMockBuilder(Workflow::class)->disableOriginalConstructor()->getMock();
 }
コード例 #7
0
 /**
  * @inheritdoc
  */
 protected function setUp()
 {
     parent::setUp();
     $this->user_memberships = $this->getMockBuilder(SiteUserMemberships::class)->disableOriginalConstructor()->getMock();
     $this->site->method('getUserMemberships')->willReturn($this->user_memberships);
     $this->user_membership = $this->getMockBuilder(SiteUserMembership::class)->disableOriginalConstructor()->getMock();
     $this->user_memberships->method('get')->willReturn($this->user_membership);
     $this->workflow = $this->getMockBuilder(Workflow::class)->disableOriginalConstructor()->getMock();
 }
コード例 #8
0
 /**
  * @inheritdoc
  */
 protected function setup()
 {
     parent::setUp();
     $this->session = $this->getMockBuilder(Session::class)->disableOriginalConstructor()->getMock();
     $this->command = new ListCommand($this->getConfig());
     $this->command->setSites($this->sites);
     $this->command->setLogger($this->logger);
     $this->command->setSession($this->session);
 }
コード例 #9
0
 /**
  * @inheritdoc
  */
 protected function setUp()
 {
     parent::setUp();
     $this->org_memberships = $this->getMockBuilder(SiteOrganizationMemberships::class)->disableOriginalConstructor()->getMock();
     $this->site->method('getOrganizationMemberships')->willReturn($this->org_memberships);
     $this->command = new ListCommand($this->getConfig());
     $this->command->setSites($this->sites);
     $this->command->setLogger($this->logger);
 }
コード例 #10
0
 /**
  * Sets up the fixture, for example, open a network connection.
  * This method is called before a test is executed.
  */
 protected function setUp()
 {
     parent::setUp();
     $this->ssh_keys = $this->getMockBuilder(SSHKeys::class)->disableOriginalConstructor()->getMock();
     $this->user = $this->getMockBuilder(User::class)->disableOriginalConstructor()->getMock();
     $this->user->expects($this->any())->method('getSSHKeys')->willReturn($this->ssh_keys);
     $this->session = $this->getMockBuilder(Session::class)->disableOriginalConstructor()->getMock();
     $this->session->method('getUser')->willReturn($this->user);
 }
コード例 #11
0
 protected function setUp()
 {
     parent::setUp();
     $this->command = new ArtCommand();
     $this->command->setConfig($this->config);
     $this->output = $this->getMockBuilder(OutputInterface::class)->getMock();
     $formatter = $this->getMockBuilder(OutputFormatterInterface::class)->getMock();
     $this->output->method('getFormatter')->willReturn($formatter);
     $this->command->setOutput($this->output);
 }
コード例 #12
0
 /**
  * @inheritdoc
  */
 protected function setUp()
 {
     parent::setUp();
     $this->organization = $this->getMockBuilder(Organization::class)->disableOriginalConstructor()->getMock();
     $this->user = $this->getMockBuilder(User::class)->disableOriginalConstructor()->getMock();
     $this->session = $this->getMockBuilder(Session::class)->disableOriginalConstructor()->getMock();
     $this->session->method('getUser')->with()->willReturn($this->user);
     $this->command = new ListCommand($this->getConfig());
     $this->command->setLogger($this->logger);
     $this->command->setSession($this->session);
 }
コード例 #13
0
 /**
  * @inheritdoc
  */
 protected function setUp()
 {
     parent::setUp();
     $this->aliases = '//Aliases';
     $this->session = $this->getMockBuilder(Session::class)->disableOriginalConstructor()->getMock();
     $this->user = $this->getMockBuilder(User::class)->disableOriginalConstructor()->getMock();
     $this->session->expects($this->once())->method('getUser')->with()->willReturn($this->user);
     $this->user->expects($this->once())->method('getAliases')->with()->willReturn($this->aliases);
     $this->command = new AliasesCommand($this->getConfig());
     $this->command->setLogger($this->logger);
     $this->command->setSession($this->session);
 }
コード例 #14
0
 /**
  * @inheritdoc
  */
 protected function setUp()
 {
     parent::setUp();
     $this->session = $this->getMockBuilder(Session::class)->disableOriginalConstructor()->getMock();
     $this->user = $this->getMockBuilder(User::class)->disableOriginalConstructor()->getMock();
     $this->payment_methods = $this->getMockBuilder(PaymentMethods::class)->disableOriginalConstructor()->getMock();
     $this->session->expects($this->once())->method('getUser')->with()->willReturn($this->user);
     $this->user->expects($this->once())->method('getPaymentMethods')->with()->willReturn($this->payment_methods);
     $this->payment_methods->expects($this->once())->method('fetch')->with()->willReturn($this->payment_methods);
     $this->command = new ListCommand($this->getConfig());
     $this->command->setSession($this->session);
     $this->command->setLogger($this->logger);
 }
コード例 #15
0
 /**
  * @inheritdoc
  */
 protected function setUp()
 {
     parent::setUp();
     $this->session = $this->getMockBuilder(Session::class)->disableOriginalConstructor()->getMock();
     $this->user = $this->getMockBuilder(User::class)->disableOriginalConstructor()->getMock();
     $this->user_org_memberships = $this->getMockBuilder(UserOrganizationMemberships::class)->disableOriginalConstructor()->getMock();
     $this->user_org_membership = $this->getMockBuilder(UserOrganizationMembership::class)->disableOriginalConstructor()->getMock();
     $this->organization = $this->getMockBuilder(Organization::class)->disableOriginalConstructor()->getMock();
     $this->organization->id = 'org_id';
     $this->session->method('getUser')->with()->willReturn($this->user);
     $this->user->method('getOrgMemberships')->with()->willReturn($this->user_org_memberships);
     $this->user_org_memberships->method('get')->with($this->equalTo($this->organization->id))->willReturn($this->user_org_membership);
     $this->user_org_membership->method('getOrganization')->with()->willReturn($this->organization);
 }
コード例 #16
0
 /**
  * @inheritdoc
  */
 public function setUp()
 {
     parent::setUp();
     $this->workflow = $this->getMockBuilder(Workflow::class)->disableOriginalConstructor()->getMock();
     // workflow succeeded
     $this->workflow->expects($this->once())->method('checkProgress')->with()->willReturn(true);
     $this->workflow->expects($this->once())->method('getMessage')->with()->willReturn('successful workflow');
     $this->environment->expects($this->once())->method('setHttpsCertificate')->with(['cert' => '*CERT*', 'key' => '*KEY*', 'intermediary' => '*INT*'])->willReturn($this->workflow);
     // should display a notice about the mode switch
     $this->logger->expects($this->at(0))->method('log')->with($this->equalTo('notice'), $this->equalTo('SSL certificate updated. Converging loadbalancer.'));
     $this->logger->expects($this->at(1))->method('log')->with($this->equalTo('notice'), $this->equalTo('successful workflow'));
     $this->command = new SetCommand();
     $this->command->setSites($this->sites);
     $this->command->setLogger($this->logger);
 }
コード例 #17
0
 /**
  * @inheritdoc
  */
 protected function setUp()
 {
     parent::setUp();
     $this->session = $this->getMockBuilder(Session::class)->disableOriginalConstructor()->getMock();
     $this->user = $this->getMockBuilder(User::class)->disableOriginalConstructor()->getMock();
     $this->upstreams = $this->getMockBuilder(Upstreams::class)->disableOriginalConstructor()->getMock();
     $this->upstream = $this->getMockBuilder(Upstream::class)->disableOriginalConstructor()->getMock();
     $this->upstream->id = 'upstream_id';
     $this->session->expects($this->once())->method('getUser')->with()->willReturn($this->user);
     $this->user->expects($this->once())->method('getUpstreams')->with()->willReturn($this->upstreams);
     $this->upstreams->expects($this->once())->method('get')->willReturn($this->upstream);
     $this->command = new CreateCommand($this->getConfig());
     $this->command->setSites($this->sites);
     $this->command->setLogger($this->logger);
     $this->command->setSession($this->session);
 }
コード例 #18
0
    /**
     * Setup the test fixture.
     */
    protected function setUp()
    {
        parent::setUp();
        $this->workflows = $this->getMockBuilder(Workflows::class)->disableOriginalConstructor()->getMock();
        $this->site->method('getWorkflows')->willReturn($this->workflows);
        $this->workflow = $this->getMockBuilder(Workflow::class)->disableOriginalConstructor()->getMock();
        $this->operation = $this->getMockBuilder(WorkflowOperation::class)->disableOriginalConstructor()->getMock();
        $this->operation->expects($this->any())->method('has')->with('log_output')->willReturn(true);
        $this->operation->expects($this->any())->method('description')->willReturn('Mock operation');
        $this->operation->expects($this->any())->method('get')->with('log_output')->willReturn('The mock operation log output.');
        $this->operation->expects($this->any())->method('serialize')->willReturn(['id' => '12345', 'log_output' => 'The mock operation log output.', 'description' => 'Mock operation']);
        $this->expected_logs = <<<'EOT'

------ Mock operation ------
The mock operation log output.

------ Mock operation ------
The mock operation log output.

EOT;
    }
コード例 #19
0
 /**
  * @inheritdoc
  */
 protected function setUp()
 {
     parent::setUp();
     $this->site->id = 'site_id';
     $this->session = $this->getMockBuilder(Session::class)->disableOriginalConstructor()->getMock();
     $user = $this->getMockBuilder(User::class)->disableOriginalConstructor()->getMock();
     $this->org_site_membership = $this->getMockBuilder(OrganizationSiteMembership::class)->disableOriginalConstructor()->getMock();
     $this->tags = $this->getMockBuilder(Tags::class)->disableOriginalConstructor()->getMock();
     $user_org_memberships = $this->getMockBuilder(UserOrganizationMemberships::class)->disableOriginalConstructor()->getMock();
     $user_org_membership = $this->getMockBuilder(UserOrganizationMembership::class)->disableOriginalConstructor()->getMock();
     $this->organization = $this->getMockBuilder(Organization::class)->disableOriginalConstructor()->getMock();
     $this->organization->id = 'org_id';
     $this->org_site_memberships = $this->getMockBuilder(OrganizationSiteMemberships::class)->disableOriginalConstructor()->getMock();
     $this->org_site_membership = $this->getMockBuilder(OrganizationSiteMembership::class)->disableOriginalConstructor()->getMock();
     $this->tags = $this->getMockBuilder(Tags::class)->disableOriginalConstructor()->getMock();
     $this->site->tags = $this->tags;
     $this->org_site_membership->method('getSite')->willReturn($this->site);
     $this->session->expects($this->once())->method('getUser')->with()->willReturn($user);
     $user->expects($this->once())->method('getOrgMemberships')->with()->willReturn($user_org_memberships);
     $user_org_memberships->expects($this->once())->method('get')->with($this->organization->id)->willReturn($user_org_membership);
     $user_org_membership->expects($this->once())->method('getOrganization')->with()->willReturn($this->organization);
     $this->organization->expects($this->once())->method('getSiteMemberships')->with()->willReturn($this->org_site_memberships);
     $this->org_site_memberships->expects($this->once())->method('get')->with($this->site->id)->willReturn($this->org_site_membership);
 }
コード例 #20
0
 /**
  * @inheritdoc
  */
 protected function setUp()
 {
     parent::setUp();
     $this->upstream = $this->getMockBuilder(Upstream::class)->disableOriginalConstructor()->getMock();
     $this->site->method('getUpstream')->willReturn($this->upstream);
 }
コード例 #21
0
 /**
  * @inheritdoc
  */
 public function setUp()
 {
     parent::setUp();
     $this->session = $this->getMockBuilder(Session::class)->disableOriginalConstructor()->getMock();
 }
コード例 #22
0
 /**
  * @inheritdoc
  */
 public function setUp()
 {
     parent::setUp();
     $this->new_relic = $this->getMockBuilder(NewRelic::class)->disableOriginalConstructor()->getMock();
     $this->site->method('getNewRelic')->willReturn($this->new_relic);
 }
コード例 #23
0
 /**
  * @inheritdoc
  */
 protected function setUp()
 {
     parent::setUp();
     $this->workflow = $this->getMockBuilder(Workflow::class)->disableOriginalConstructor()->getMock();
 }