OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
firebase
/
vendor
/
google
/
cloud-storage
/
tests
/
Unit
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
08/12/2024 10:33:53 AM
rwxr-xr-x
📄
AclTest.php
3.22 KB
08/12/2024 10:33:53 AM
rw-r--r--
📄
BucketTest.php
23.21 KB
08/12/2024 10:33:53 AM
rw-r--r--
📄
ConformanceTest.php
6.93 KB
08/12/2024 10:33:53 AM
rw-r--r--
📁
Connection
-
08/12/2024 10:35:02 AM
rwxr-xr-x
📄
CreatedHmacKeyTest.php
1.45 KB
08/12/2024 10:33:53 AM
rw-r--r--
📄
EncryptionTraitTest.php
4.76 KB
08/12/2024 10:33:53 AM
rw-r--r--
📄
HmacKeyTest.php
3.91 KB
08/12/2024 10:33:53 AM
rw-r--r--
📄
LifecycleTest.php
6.48 KB
08/12/2024 10:33:53 AM
rw-r--r--
📄
NotificationTest.php
3.78 KB
08/12/2024 10:33:53 AM
rw-r--r--
📄
ObjectIteratorTest.php
1.3 KB
08/12/2024 10:33:53 AM
rw-r--r--
📄
ObjectPageIteratorTest.php
1.5 KB
08/12/2024 10:33:53 AM
rw-r--r--
📄
ReadStreamTest.php
2.33 KB
08/12/2024 10:33:54 AM
rw-r--r--
📄
RequesterPaysTest.php
14.85 KB
08/12/2024 10:33:54 AM
rw-r--r--
📄
SigningHelperTest.php
25.94 KB
08/12/2024 10:33:54 AM
rw-r--r--
📄
StorageClientTest.php
9.93 KB
08/12/2024 10:33:54 AM
rw-r--r--
📄
StorageObjectTest.php
35.64 KB
08/12/2024 10:33:54 AM
rw-r--r--
📄
StreamWrapperTest.php
17.01 KB
08/12/2024 10:33:54 AM
rw-r--r--
📄
WriteStreamTest.php
1.93 KB
08/12/2024 10:33:54 AM
rw-r--r--
📁
data
-
08/12/2024 10:35:02 AM
rwxr-xr-x
Editing: AclTest.php
Close
<?php /** * Copyright 2015 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ namespace Google\Cloud\Storage\Tests\Unit; use Google\Cloud\Storage\Acl; use Google\Cloud\Storage\Connection\ConnectionInterface; use InvalidArgumentException; use PHPUnit\Framework\TestCase; use Prophecy\Argument; use Prophecy\PhpUnit\ProphecyTrait; /** * @group storage */ class AclTest extends TestCase { use ProphecyTrait; public $connection; public function setUp(): void { $this->connection = $this->prophesize(ConnectionInterface::class); } public function testThrowsExceptionWithInvalidType() { $this->expectException(InvalidArgumentException::class); $acl = new Acl($this->connection->reveal(), 'nope', ['bucket' => 'bucket']); } public function testDelete() { $acl = new Acl($this->connection->reveal(), 'bucketAccessControls', ['bucket' => 'bucket']); $this->assertNull($acl->delete('owner')); } public function testGetAll() { $accessControls = [ ['entity' => 'allAuthenticatedUsers'] ]; $this->connection->listAcl(Argument::any())->willReturn(['items' => $accessControls]); $acl = new Acl($this->connection->reveal(), 'bucketAccessControls', ['bucket' => 'bucket']); $this->assertEquals($accessControls, $acl->get()); } public function testGetWithSpecifiedEntity() { $accessControl = [ 'entity' => 'allAuthenticatedUsers' ]; $this->connection->getAcl(Argument::any())->willReturn($accessControl); $acl = new Acl($this->connection->reveal(), 'bucketAccessControls', ['bucket' => 'bucket']); $this->assertEquals($accessControl, $acl->get(['entity' => 'allAuthenticatedUsers'])); } public function testAdd() { $accessControl = [ 'entity' => 'allAuthenticatedUsers', 'role' => 'READER' ]; $this->connection->insertAcl(Argument::any())->willReturn($accessControl); $acl = new Acl($this->connection->reveal(), 'bucketAccessControls', ['bucket' => 'bucket']); $this->assertEquals($accessControl, $acl->add('allAuthenticatedUsers', 'READER')); } public function testUpdate() { $accessControl = [ 'entity' => 'allAuthenticatedUsers', 'role' => 'WRITER' ]; $this->connection->patchAcl(Argument::any())->willReturn($accessControl); $acl = new Acl($this->connection->reveal(), 'bucketAccessControls', ['bucket' => 'bucket']); $this->assertEquals($accessControl, $acl->update('allAuthenticatedUsers', 'WRITER')); } }