|
32 | 32 | use App\Test\Lib\Model\GroupsUsersModelTrait;
|
33 | 33 | use App\Test\Lib\Model\PermissionsModelTrait;
|
34 | 34 | use App\Utility\UuidFactory;
|
35 |
| -use Cake\Core\Configure; |
36 | 35 | use Cake\Utility\Hash;
|
37 | 36 | use Passbolt\Folders\Test\Lib\FoldersIntegrationTestCase;
|
38 | 37 | use Passbolt\Folders\Test\Lib\Model\FoldersModelTrait;
|
@@ -63,57 +62,6 @@ class FoldersIndexControllerTest extends FoldersIntegrationTestCase
|
63 | 62 | GroupsFixture::class,
|
64 | 63 | ];
|
65 | 64 |
|
66 |
| - public function setUp(): void |
67 |
| - { |
68 |
| - parent::setUp(); |
69 |
| - Configure::write('passbolt.plugins.folders', ['enabled' => true]); |
70 |
| - } |
71 |
| - |
72 |
| - private function insertFixtureCase1() |
73 |
| - { |
74 |
| - // Ada has access to folder Lovelace and Something as a OWNER |
75 |
| - // Lovelace (Ada:O) Something (Ada:O) |
76 |
| - $userId = UuidFactory::uuid('user.id.ada'); |
77 |
| - $folderA = $this->addFolderFor(['name' => 'Lovelace'], [$userId => Permission::OWNER]); |
78 |
| - $this->addFolderFor(['name' => 'Something', 'folder_parent_id' => $folderA->id], [$userId => Permission::OWNER]); |
79 |
| - } |
80 |
| - |
81 |
| - /** |
82 |
| - * @return void |
83 |
| - */ |
84 |
| - public function testFoldersIndexFilterBySearchSuccess() |
85 |
| - { |
86 |
| - $this->insertFixtureCase1(); |
87 |
| - |
88 |
| - $this->authenticateAs('ada'); |
89 |
| - |
90 |
| - $this->getJson('/folders.json?api-version=2&filter[search]=Love'); |
91 |
| - $this->assertSuccess(); |
92 |
| - $this->assertEquals(count($this->_responseJsonBody), 1); |
93 |
| - $this->assertEquals($this->_responseJsonBody[0]->name, 'Lovelace'); |
94 |
| - $this->assertNotContains('Something', $this->_responseJsonBody); |
95 |
| - |
96 |
| - $this->getJson('/folders.json?api-version=2&filter[search]=ovela'); |
97 |
| - $this->assertSuccess(); |
98 |
| - $this->assertEquals(count($this->_responseJsonBody), 1); |
99 |
| - $this->assertEquals($this->_responseJsonBody[0]->name, 'Lovelace'); |
100 |
| - $this->assertNotContains('Something', $this->_responseJsonBody); |
101 |
| - |
102 |
| - $this->getJson('/folders.json?api-version=2&filter[search]=ace'); |
103 |
| - $this->assertSuccess(); |
104 |
| - $this->assertEquals(count($this->_responseJsonBody), 1); |
105 |
| - $this->assertEquals($this->_responseJsonBody[0]->name, 'Lovelace'); |
106 |
| - $this->assertNotContains('Something', $this->_responseJsonBody); |
107 |
| - |
108 |
| - $this->getJson('/folders.json?api-version=2&filter[search]=Lovelace'); |
109 |
| - $this->assertSuccess(); |
110 |
| - $this->assertEquals(count($this->_responseJsonBody), 1); |
111 |
| - $this->assertEquals($this->_responseJsonBody[0]->name, 'Lovelace'); |
112 |
| - $this->assertNotContains('Something', $this->_responseJsonBody); |
113 |
| - |
114 |
| - $this->assertSuccess(); |
115 |
| - } |
116 |
| - |
117 | 65 | private function insertFixtureCase2()
|
118 | 66 | {
|
119 | 67 | // Ada has access to folder Lovelace and Something as a OWNER
|
|
0 commit comments