Skip to content

Commit 29aeaec

Browse files
authored
Merge pull request #1 from digitalutsc/feat/add-ci-and-linting
feat/add-ci-and-linting
2 parents 26c9d7d + 696d499 commit 29aeaec

6 files changed

Lines changed: 76 additions & 5 deletions

File tree

.github/workflows/ci.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
islandora-module-ci:
12+
uses: digitalutsc/reusable_workflows/.github/workflows/islandora-module-ci.yml@main
13+
with:
14+
module_name: serve_iiif_file
15+
install_chromedriver: true

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
"name": "islandora_lite/serve_iiif_file",
33
"type": "drupal-module",
44
"description": "Gets static IIIF files for the Islandora mirador viewer",
5-
"keywords": ["Drupal"]
5+
"keywords": ["Drupal"],
6+
"require": {}
67
}

serve_iiif_file.info.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
type: module
22
name: Serve IIIF File
33
description: Serve iiif files which can be configured in the backend.
4-
core_version_requirement: ^8 || ^9 || ^10
4+
core_version_requirement: ^8 || ^9 || ^10 || ^11

serve_iiif_file.routing.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ serve_iiif_file.content:
88
options:
99
parameters:
1010
book_node:
11-
type: entity:node
11+
type: entity:node

src/Controller/ServeIIIFFileController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
use Symfony\Component\HttpFoundation\Response;
1010

1111
/**
12-
*
12+
* Controller for serving IIIF manifest files.
1313
*/
1414
class ServeIIIFFileController {
1515

1616
/**
17-
*
17+
* Serves IIIF manifest files.
1818
*/
1919
public function content(NodeInterface $book_node) {
2020

tests/src/Functional/LoadTest.php

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<?php
2+
3+
namespace Drupal\Tests\serve_iiif_file\Functional;
4+
5+
use Drupal\Tests\BrowserTestBase;
6+
use PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses;
7+
8+
/**
9+
* Simple test to ensure that main page loads with module enabled.
10+
*
11+
* @group serve_iiif_file
12+
*/
13+
#[RunTestsInSeparateProcesses]
14+
class LoadTest extends BrowserTestBase {
15+
16+
/**
17+
* {@inheritdoc}
18+
*/
19+
protected $defaultTheme = 'stark';
20+
21+
/**
22+
* Modules to enable.
23+
*
24+
* @var array
25+
*/
26+
protected static $modules = ['serve_iiif_file'];
27+
28+
/**
29+
* A user with permissions required to access the configuration form.
30+
*
31+
* @var \Drupal\user\UserInterface
32+
*/
33+
protected $user;
34+
35+
/**
36+
* {@inheritdoc}
37+
*/
38+
protected function setUp(): void {
39+
parent::setUp();
40+
$this->user = $this->drupalCreateUser([
41+
'access administration pages',
42+
'administer site configuration',
43+
]);
44+
$this->drupalLogin($this->user);
45+
}
46+
47+
/**
48+
* Tests that the home page loads with a 200 response.
49+
*/
50+
public function testLoad(): void {
51+
$this->drupalGet('<front>');
52+
$this->assertSession()->statusCodeEquals(200);
53+
}
54+
55+
}

0 commit comments

Comments
 (0)