Example #1
0
 /**
  * Tests assumeRoleWithWebIdentity method.
  * 
  * @return void
  */
 public function testAssumeRoleWithWebIdentity()
 {
     $this->if($stsClient = $this->createStsClientMock())->and($client = new Base($stsClient))->and($stsClient->getMockController()->assumeRoleWithWebIdentity = null)->and($client = new Base($stsClient))->and($client->assumeRoleWithWebIdentity($roleArn = uniqid(), $roleSessionName = uniqid(), $webIdentityToken = uniqid()))->then->mock($stsClient)->call('assumeRoleWithWebIdentity')->withArguments(['RoleArn' => $roleArn, 'RoleSessionName' => $roleSessionName, 'WebIdentityToken' => $webIdentityToken, 'DurationSeconds' => 3600])->once();
     $this->if($stsClient = $this->createStsClientMock())->and($client = new Base($stsClient))->and($stsClient->getMockController()->assumeRoleWithWebIdentity = null)->and($client = new Base($stsClient))->and($client->assumeRoleWithWebIdentity($roleArn = uniqid(), $roleSessionName = uniqid(), $webIdentityToken = uniqid(), $providerId = uniqid(), $policy = uniqid(), $durationSeconds = rand()))->then->mock($stsClient)->call('assumeRoleWithWebIdentity')->withArguments(['RoleArn' => $roleArn, 'RoleSessionName' => $roleSessionName, 'WebIdentityToken' => $webIdentityToken, 'ProviderId' => $providerId, 'Policy' => $policy, 'DurationSeconds' => $durationSeconds])->once();
 }