Skip to content

Commit

Permalink
optimize ci and improve unittest
Browse files Browse the repository at this point in the history
  • Loading branch information
ferishili committed Jul 21, 2023
1 parent 2161a53 commit 771883c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
1 change: 0 additions & 1 deletion .github/workflows/opencast-php-lib-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ jobs:
uses: ramsey/composer-install@v2
with:
dependency-versions: ${{ matrix.dependency-versions }}
custom-cache-key: composer-${{ matrix.php-version }}-${{ matrix.dependency-versions }}-${{ hashFiles('**/composer.lock') }}

- name: PHP Compatibility
run: composer sniffer:php${{ matrix.php-version }}
Expand Down
12 changes: 11 additions & 1 deletion tests/Unit/OcEventsApiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function empty_random_event_id(): string
*/
public function get_single_event(string $identifier): string
{
$responseAll = $this->ocEventsApi->getAll(['withacl' => true]);
$responseAll = $this->ocEventsApi->getAll(['withacl' => true]);
$this->assertSame(200, $responseAll['code'], 'Failure to get event list');
$events = $responseAll['body'];
if (!empty($events)) {
Expand Down Expand Up @@ -175,6 +175,16 @@ public function get_update_delete_acls(string $identifier): string
$this->assertSame(200, $response1['code'], 'Failure to get ACLs of an event');

$acls = $response1['body'];
if (empty($acls)) {
$response1_1 = $this->ocEventsApi->addSingleAcl($identifier, 'write', 'ROLE_PHPUNIT_TESTING_USER_0');
$this->assertSame(204, $response1_1['code'], 'Failure to set single ACL for an event');

$response1_2 = $this->ocEventsApi->getAcl($identifier);
$this->assertSame(200, $response1_2['code'], 'Failure to get ACLs of an event');

$acls = $response1_2['body'];
}

$this->assertNotEmpty($acls);

// Delete all acls.
Expand Down

0 comments on commit 771883c

Please sign in to comment.