Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ on:
jobs:
build:

runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

strategy:
matrix:
versions: [{php: '8.1', solr: '9.9.0'}]
versions: [{php: '8.1', solr: '9.10.1'}, {php: '8.2', solr: '9.10.1'}]
fail-fast: false

name: PHP ${{ matrix.versions.php }} Test

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v5

- name: Setup PHP ${{ matrix.versions.php }}
uses: shivammathur/setup-php@v2
Expand All @@ -40,7 +40,7 @@ jobs:

- name: Get Solr ${{ matrix.versions.solr }} from Cache
id: cache-solr
uses: actions/cache@v3
uses: actions/cache@v5
with:
path: downloads
key: solr-${{ matrix.versions.solr }}
Expand Down Expand Up @@ -77,7 +77,7 @@ jobs:

- name: Test-admin
run: php composer.phar test -- --testsuite admin

- name: Test-security
run: php composer.phar test -- --testsuite security

Expand Down
26 changes: 13 additions & 13 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@
# vi: set ft=ruby :

$software = <<SCRIPT
# Downgrade to PHP 8.1
# Downgrade to PHP 8.2
apt-add-repository -y ppa:ondrej/php
apt-get -yq update
apt-get -yq install php8.1
apt-get -yq install php8.2

# Install MYSQL
debconf-set-selections <<< "mysql-server mysql-server/root_password password root"
debconf-set-selections <<< "mysql-server mysql-server/root_password_again password root"
apt-get -yq install mysql-server

# Install required PHP packages
apt-get -yq install php8.1-dom
apt-get -yq install php8.1-mbstring
apt-get -yq install php8.1-intl
apt-get -yq install php8.1-gd
apt-get -yq install php8.1-mcrypt
apt-get -yq install php8.1-curl
apt-get -yq install php8.1-zip
apt-get -yq install php8.1-mysql
apt-get -yq install php8.1-yaml
apt-get -yq install php8.2-dom
apt-get -yq install php8.2-mbstring
apt-get -yq install php8.2-intl
apt-get -yq install php8.2-gd
apt-get -yq install php8.2-mcrypt
apt-get -yq install php8.2-curl
apt-get -yq install php8.2-zip
apt-get -yq install php8.2-mysql
apt-get -yq install php8.2-yaml

# Install Java
apt-get -yq install openjdk-11-jdk
Expand Down Expand Up @@ -155,15 +155,15 @@ echo "You can use 'ant reset-testdata' to reinitialize the database."
SCRIPT

Vagrant.configure("2") do |config|
config.vm.box = "bento/ubuntu-22.04"
config.vm.box = "bento/ubuntu-24.04"

config.vm.synced_folder "workspace", "/vagrant/workspace", group: "www-data", create: true

config.vm.network "forwarded_port", guest: 80 , host: 8080, host_ip: "127.0.0.1"
config.vm.network "forwarded_port", guest: 8983, host: 9983, host_ip: "127.0.0.1"
config.vm.network "forwarded_port", guest: 3306, host: 3307, host_ip: "127.0.0.1"

ENV['SOLR_VERSION']="9.6.1"
ENV['SOLR_VERSION']="9.10.1"

config.vm.provision "Install required software...", type: "shell", inline: $software
config.vm.provision "Install pandoc...", type: "shell", inline: $pandoc
Expand Down
4 changes: 1 addition & 3 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@
<property name="dbAdminPassword" value="" />
<property name="solrIndexHost" value="localhost" />
<property name="solrIndexPort" value="8983" />
<condition property="solrIndexPath" value="/" else="/solr">
<equals arg1="${phpVersion}" arg2="8.1" />
</condition>
<property name="solrIndexPath" value="/" />
<property name="solrIndexCore" value="opus4" />

<target name="analyse-code" depends="phpcs,phpmd,phpcpd,phploc" />
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"ext-readline": "*",
"ext-sockets": "*",
"ext-yaml": "*",
"opus4/zf1-future": "1.21.*",
"opus4/zf1-future": "1.25.0.x-dev as 1.21.4.x-dev",
"jpgraph/jpgraph": "dev-master",
"opus4-repo/opus4-common": "dev-master as 4.8.1",
"opus4-repo/framework": "dev-master as 4.8.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,14 @@ protected function processOptions(InputInterface $input)
if ($srcRoleName !== null && $srcColNumber !== null) {
$role = CollectionRole::fetchByName($srcRoleName);
if ($role === null) {
throw new Exception("CollectionRole with name '${srcRoleName}' not found.");
throw new Exception("CollectionRole with name '{$srcRoleName}' not found.");
}
$collections = Collection::getModelRepository()->fetchCollectionsByRoleNumber(
$role->getId(),
$srcColNumber
);
if (count($collections) === 0) {
throw new Exception("No collection found for role '${srcRoleName}' and number '$srcColNumber'.");
throw new Exception("No collection found for role '{$srcRoleName}' and number '$srcColNumber'.");
}
$this->sourceCol = $collections[0];
}
Expand All @@ -137,14 +137,14 @@ protected function processOptions(InputInterface $input)
if ($destRoleName !== null && $destColNumber !== null) {
$role = CollectionRole::fetchByName($destRoleName);
if ($role === null) {
throw new Exception("CollectionRole with name '${destRoleName}' not found.");
throw new Exception("CollectionRole with name '{$destRoleName}' not found.");
}
$collections = Collection::getModelRepository()->fetchCollectionsByRoleNumber(
$role->getId(),
$destColNumber
);
if (count($collections) === 0) {
throw new Exception("No collection found for role '${destRoleName}' and number '$destColNumber'.");
throw new Exception("No collection found for role '{$destRoleName}' and number '$destColNumber'.");
}
$this->destCol = $collections[0];
}
Expand Down
8 changes: 4 additions & 4 deletions library/Application/Console/Collection/CopyCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$sourceCount = count($sourceDocuments);

if ($sourceCount === 0) {
$output->writeln("Collection (ID = ${sourceId}) does not contain documents.");
$output->writeln("Collection (ID = {$sourceId}) does not contain documents.");
$output->writeln('');
$output->writeln(' "' . $sourceCol->getDisplayName() . '"');
$output->writeln('');
Expand All @@ -87,15 +87,15 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$moveCount = count($moveDocuments);

if ($moveCount === 0) {
$output->writeln("Destination collection already contains all the documents (${sourceCount}) of source collection.");
$output->writeln("Destination collection already contains all the documents ({$sourceCount}) of source collection.");
return self::SUCCESS;
}

$output->writeln("Copy documents (${moveCount}) from source collection (ID = ${sourceId})");
$output->writeln("Copy documents ({$moveCount}) from source collection (ID = {$sourceId})");
$output->writeln('');
$output->writeln(' "' . $sourceCol->getDisplayName() . '"');
$output->writeln('');
$output->writeln("to destination collection (ID = ${destId})");
$output->writeln("to destination collection (ID = {$destId})");
$output->writeln('');
$output->writeln(' "' . $destCol->getDisplayName() . '"');
$output->writeln('');
Expand Down
6 changes: 3 additions & 3 deletions library/Application/Console/Collection/MoveCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,18 +75,18 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$sourceCount = count($sourceDocuments);

if ($sourceCount === 0) {
$output->writeln("Collection (ID = ${sourceId}) does not contain documents.");
$output->writeln("Collection (ID = {$sourceId}) does not contain documents.");
$output->writeln('');
$output->writeln(' "' . $sourceCol->getDisplayName() . '"');
$output->writeln('');
return self::SUCCESS;
}

$output->writeln("Move documents (${sourceCount}) from source collection (ID = ${sourceId})");
$output->writeln("Move documents ({$sourceCount}) from source collection (ID = {$sourceId})");
$output->writeln('');
$output->writeln(' "' . $sourceCol->getDisplayName() . '"');
$output->writeln('');
$output->writeln("to destination collection (ID = ${destId})");
$output->writeln("to destination collection (ID = {$destId})");
$output->writeln('');
$output->writeln(' "' . $destCol->getDisplayName() . '"');
$output->writeln('');
Expand Down
14 changes: 7 additions & 7 deletions library/Application/Console/Collection/RemoveCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$targetCount = count($targetDocuments);

if ($targetCount === 0) {
$output->writeln("Collection (ID = ${targetId}) does not contain documents.");
$output->writeln("Collection (ID = {$targetId}) does not contain documents.");
$output->writeln('');
$output->writeln(' "' . $targetCol->getDisplayName() . '"');
$output->writeln('');
Expand All @@ -220,7 +220,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$removeDocuments = null;

if ($filterCol === null) {
$output->writeln("Remove all documents (${targetCount}) from collection (ID = ${targetId})");
$output->writeln("Remove all documents ({$targetCount}) from collection (ID = {$targetId})");
$output->writeln('');
$output->writeln(' "' . $targetCol->getDisplayName() . '"');
$output->writeln('');
Expand All @@ -231,7 +231,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$filterCount = count($filterDocuments);

if ($filterCount === 0) {
$output->writeln("The filter collection (ID = ${filterId}) does not contain any documents.");
$output->writeln("The filter collection (ID = {$filterId}) does not contain any documents.");
$output->writeln('');
$output->writeln(' "' . $filterCol->getDisplayName() . '"');
$output->writeln('');
Expand All @@ -242,22 +242,22 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$removeCount = count($removeDocuments);

if ($removeCount === 0) {
$output->writeln("Non of the documents in the filter collection (ID = ${filterId})");
$output->writeln("Non of the documents in the filter collection (ID = {$filterId})");
$output->writeln('');
$output->writeln(' "' . $filterCol->getDisplayName() . '"');
$output->writeln('');
$output->writeln("are present in the target collection (ID= ${targetId})");
$output->writeln("are present in the target collection (ID= {$targetId})");
$output->writeln('');
$output->writeln(' "' . $targetCol->getDisplayName() . '"');
$output->writeln('');
return self::FAILURE;
}

$output->writeln("Remove documents (${filterCount}) in collection (ID = ${filterId})");
$output->writeln("Remove documents ({$filterCount}) in collection (ID = {$filterId})");
$output->writeln('');
$output->writeln(' "' . $filterCol->getDisplayName() . '"');
$output->writeln('');
$output->writeln("from collection (ID= ${targetId})");
$output->writeln("from collection (ID= {$targetId})");
$output->writeln('');
$output->writeln(' "' . $targetCol->getDisplayName() . '"');
$output->writeln('');
Expand Down
3 changes: 3 additions & 0 deletions library/Application/Controller/Plugin/SecurityRealm.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
*/
class Application_Controller_Plugin_SecurityRealm extends Zend_Controller_Plugin_Abstract
{
/** @var array */
private $groups;

/**
* Determine the current User's security role and set up Realm.
*
Expand Down
3 changes: 3 additions & 0 deletions library/Application/Util/BrowsingParams.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ class Application_Util_BrowsingParams
/** @var Zend_Controller_Request_Http */
private $request;

/** @var Zend_Log */
private $log;

/**
* @param Zend_Controller_Request_Http $request
* @param Zend_Log $log
Expand Down
2 changes: 1 addition & 1 deletion tests/bin/install_solr_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ cd ../solr-$SOLR_VERSION
./bin/solr start -force --user-managed
./bin/solr create -c opus4
cd server/solr/opus4/conf/
rm -f managed-schema schema.xml solrconfig.xml
rm -f *
ln -s ../../../../../vendor/opus4-repo/search/conf/schema.xml schema.xml
ln -s ../../../../../vendor/opus4-repo/search/conf/solrconfig.xml solrconfig.xml
cd ../../../../
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public function testMoveDocumentsFromEmptyCollection()

$colId1 = $col2->getId();

$this->assertStringContainsString("Collection (ID = ${colId1}) does not contain documents.", $output);
$this->assertStringContainsString("Collection (ID = {$colId1}) does not contain documents.", $output);
}

public function testCollectionIdNotFound()
Expand Down Expand Up @@ -217,7 +217,7 @@ public function testSourceCollectionUsingUnknownColNumberNotFound()
$this->assertCount(0, $col2->getDocumentIds());

$this->expectException(Exception::class);
$this->expectExceptionMessage("No collection found for role '${roleName}' and number 'col3'.");
$this->expectExceptionMessage("No collection found for role '{$roleName}' and number 'col3'.");

$this->tester->execute([
'--no-interaction' => true,
Expand Down Expand Up @@ -265,7 +265,7 @@ public function testDestinationCollectionUsingUnknownColNumberNotFound()
$this->assertCount(0, $col2->getDocumentIds());

$this->expectException(Exception::class);
$this->expectExceptionMessage("No collection found for role '${roleName}' and number 'col3'.");
$this->expectExceptionMessage("No collection found for role '{$roleName}' and number 'col3'.");

$this->tester->execute([
'--no-interaction' => true,
Expand Down
7 changes: 0 additions & 7 deletions tests/modules/ControllerTestCaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,13 +179,6 @@ public function testDisableEnableTranslation()

$translator = Application_Translate::getInstance();
$this->assertFalse($translator->isTranslated('LastName'));

$this->enableTranslation();

$translator = Application_Translate::getInstance();
$this->assertTrue($translator->isTranslated('LastName'));

$this->assertSame($defaultTranslator, $translator);
}

public function testGetWorkspacePath()
Expand Down
3 changes: 3 additions & 0 deletions tests/modules/admin/forms/Document/NoteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
*/
class Admin_Form_Document_NoteTest extends ControllerTestCase
{
/** @var string[] */
protected $additionalResources = ['database'];

public function testCreateForm()
{
$form = new Admin_Form_Document_Note();
Expand Down
6 changes: 3 additions & 3 deletions tests/modules/frontdoor/controllers/IndexControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1586,11 +1586,11 @@ public function testRenderingGndSubjectLink()
$config = $this->getConfig();
$gndLinkUrl = $config->gnd->baseUrl . '4130303-9';

$this->dispatch("/frontdoor/index/index/docId/${docId}");
$this->dispatch("/frontdoor/index/index/docId/{$docId}");

$this->assertXpath("//a[@href=\"${gndLinkUrl}\"]");
$this->assertXpath("//a[@href=\"{$gndLinkUrl}\"]");
$this->assertXpathContentContains('//em[contains(@class,"subject")]', 'Bauhaus');
$this->assertXpathContentContains("//a[@href=\"${gndLinkUrl}\"]", 'GND');
$this->assertXpathContentContains("//a[@href=\"{$gndLinkUrl}\"]", 'GND');

$this->assertXpathContentContains('//em[contains(@class, "subject")]', 'mytag');
$this->assertNotXpathContentContains('//a', 'mytag'); // no link for 'mytag'
Expand Down
2 changes: 1 addition & 1 deletion tests/modules/frontdoor/models/AuthorsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ public function testGetContactableAuthorsNoAuthors()
$author->setFirstName('John');
$author->setLastName('Doe');
$author->setEmail('doe@example.org');
$this->authorId = $author->store();
$author->store();

$linkPerson = $doc->addPersonAuthor($author);
$linkPerson->setAllowEmailContact(false);
Expand Down
Loading