/**
  * Execute the DescribeTrails and DeleteTrail operations
  *
  * @example Aws\CloudTrail\CloudTrailClient::deleteTrail
  * @example Aws\CloudTrail\CloudTrailClient::getDescribeTrailsIterator
  * @depends testStopLogging
  */
 public function testDeleteTrails($bucket)
 {
     $client = $this->cloudtrail;
     // @begin
     // List and delete all of the trails
     $trails = $client->getDescribeTrailsIterator();
     foreach ($trails as $trail) {
         $client->deleteTrail(array('Name' => $trail['Name']));
         echo "Deleted trail {$trail['Name']}.\n";
     }
     // @end
     $this->assertEquals("Deleted trail test-trail.\n", $this->getActualOutput());
     // Clean up test bucket
     sleep(5);
     if ($this->s3->doesBucketExist($bucket)) {
         $this->s3->clearBucket($bucket);
         $this->s3->deleteBucket(array('Bucket' => $bucket));
     }
 }
Example #2
0
 /**
  * Helper used to clear the contents of a bucket. Use the {@see ClearBucket} object directly
  * for more advanced options and control.
  *
  * @param string $bucket Name of the bucket to clear.
  *
  * @return int Returns the number of deleted keys
  */
 public function clearBucket($bucket)
 {
     return $this->instance->clearBucket($bucket);
 }
Example #3
0
 /**
  * clear
  *
  * @return integer
  */
 public function clear()
 {
     return $this->client->clearBucket($this->name);
 }