Skip to content

Commit 771883c

Browse files
committed
optimize ci and improve unittest
1 parent 2161a53 commit 771883c

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

.github/workflows/opencast-php-lib-ci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ jobs:
3333
uses: ramsey/composer-install@v2
3434
with:
3535
dependency-versions: ${{ matrix.dependency-versions }}
36-
custom-cache-key: composer-${{ matrix.php-version }}-${{ matrix.dependency-versions }}-${{ hashFiles('**/composer.lock') }}
3736

3837
- name: PHP Compatibility
3938
run: composer sniffer:php${{ matrix.php-version }}

tests/Unit/OcEventsApiTest.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function empty_random_event_id(): string
5454
*/
5555
public function get_single_event(string $identifier): string
5656
{
57-
$responseAll = $this->ocEventsApi->getAll(['withacl' => true]);
57+
$responseAll = $this->ocEventsApi->getAll(['withacl' => true]);
5858
$this->assertSame(200, $responseAll['code'], 'Failure to get event list');
5959
$events = $responseAll['body'];
6060
if (!empty($events)) {
@@ -175,6 +175,16 @@ public function get_update_delete_acls(string $identifier): string
175175
$this->assertSame(200, $response1['code'], 'Failure to get ACLs of an event');
176176

177177
$acls = $response1['body'];
178+
if (empty($acls)) {
179+
$response1_1 = $this->ocEventsApi->addSingleAcl($identifier, 'write', 'ROLE_PHPUNIT_TESTING_USER_0');
180+
$this->assertSame(204, $response1_1['code'], 'Failure to set single ACL for an event');
181+
182+
$response1_2 = $this->ocEventsApi->getAcl($identifier);
183+
$this->assertSame(200, $response1_2['code'], 'Failure to get ACLs of an event');
184+
185+
$acls = $response1_2['body'];
186+
}
187+
178188
$this->assertNotEmpty($acls);
179189

180190
// Delete all acls.

0 commit comments

Comments
 (0)