diff --git a/controller/Controller.php b/controller/Controller.php index 94ab0fb62..c500677db 100644 --- a/controller/Controller.php +++ b/controller/Controller.php @@ -48,6 +48,7 @@ public function setLanguageProperties($lang) { if (array_key_exists($lang, $this->languages)) { $locale = $this->languages[$lang]['locale']; + putenv("LANGUAGE=$locale"); putenv("LC_ALL=$locale"); setlocale(LC_ALL, $locale); } else { diff --git a/tests/ConceptMappingPropertyValueTest.php b/tests/ConceptMappingPropertyValueTest.php index 9a3a970fa..215210499 100644 --- a/tests/ConceptMappingPropertyValueTest.php +++ b/tests/ConceptMappingPropertyValueTest.php @@ -8,6 +8,7 @@ class ConceptMappingPropertyValueTest extends PHPUnit\Framework\TestCase private $props; protected function setUp() { + putenv("LANGUAGE=en_GB.utf8"); putenv("LC_ALL=en_GB.utf8"); setlocale(LC_ALL, 'en_GB.utf8'); bindtextdomain('skosmos', 'resource/translations'); diff --git a/tests/ConceptPropertyTest.php b/tests/ConceptPropertyTest.php index 938091f70..f81f0bec2 100644 --- a/tests/ConceptPropertyTest.php +++ b/tests/ConceptPropertyTest.php @@ -5,6 +5,7 @@ class ConceptPropertyTest extends PHPUnit\Framework\TestCase private $model; protected function setUp() { + putenv("LANGUAGE=en_GB.utf8"); putenv("LC_ALL=en_GB.utf8"); setlocale(LC_ALL, 'en_GB.utf8'); bindtextdomain('skosmos', 'resource/translations'); diff --git a/tests/ConceptPropertyValueLiteralTest.php b/tests/ConceptPropertyValueLiteralTest.php index c99d71d6d..fa8ca5d1b 100644 --- a/tests/ConceptPropertyValueLiteralTest.php +++ b/tests/ConceptPropertyValueLiteralTest.php @@ -7,6 +7,7 @@ class ConceptPropertyValueLiteralTest extends PHPUnit\Framework\TestCase private $vocab; protected function setUp() { + putenv("LANGUAGE=en_GB.utf8"); putenv("LC_ALL=en_GB.utf8"); setlocale(LC_ALL, 'en_GB.utf8'); bindtextdomain('skosmos', 'resource/translations'); diff --git a/tests/ConceptPropertyValueTest.php b/tests/ConceptPropertyValueTest.php index 07dae4aee..3fb4601ca 100644 --- a/tests/ConceptPropertyValueTest.php +++ b/tests/ConceptPropertyValueTest.php @@ -7,6 +7,7 @@ class ConceptPropertyValueTest extends PHPUnit\Framework\TestCase private $vocab; protected function setUp() { + putenv("LANGUAGE=en_GB.utf8"); putenv("LC_ALL=en_GB.utf8"); setlocale(LC_ALL, 'en_GB.utf8'); bindtextdomain('skosmos', 'resource/translations'); diff --git a/tests/ConceptSearchParametersTest.php b/tests/ConceptSearchParametersTest.php index 1a98215fd..f6c70694a 100644 --- a/tests/ConceptSearchParametersTest.php +++ b/tests/ConceptSearchParametersTest.php @@ -6,6 +6,7 @@ class ConceptSearchParametersTest extends PHPUnit\Framework\TestCase private $request; protected function setUp() { + putenv("LANGUAGE=en_GB.utf8"); putenv("LC_ALL=en_GB.utf8"); setlocale(LC_ALL, 'en_GB.utf8'); $this->request = $this->getMockBuilder('Request')->disableOriginalConstructor()->getMock(); diff --git a/tests/ConceptTest.php b/tests/ConceptTest.php index 25d35ca74..a2440b1ea 100644 --- a/tests/ConceptTest.php +++ b/tests/ConceptTest.php @@ -8,6 +8,7 @@ class ConceptTest extends PHPUnit\Framework\TestCase private $cbdGraph; protected function setUp() { + putenv("LANGUAGE=en_GB.utf8"); putenv("LC_ALL=en_GB.utf8"); setlocale(LC_ALL, 'en_GB.utf8'); bindtextdomain('skosmos', 'resource/translations'); diff --git a/tests/GenericSparqlTest.php b/tests/GenericSparqlTest.php index 7367c8772..5604bbf70 100644 --- a/tests/GenericSparqlTest.php +++ b/tests/GenericSparqlTest.php @@ -9,6 +9,7 @@ class GenericSparqlTest extends PHPUnit\Framework\TestCase private $params; protected function setUp() { + putenv("LANGUAGE=en_GB.utf8"); putenv("LC_ALL=en_GB.utf8"); setlocale(LC_ALL, 'en_GB.utf8'); $this->model = new Model(new GlobalConfig('/../tests/testconfig.ttl')); diff --git a/tests/JenaTextSparqlTest.php b/tests/JenaTextSparqlTest.php index 371bfe425..9189fd809 100644 --- a/tests/JenaTextSparqlTest.php +++ b/tests/JenaTextSparqlTest.php @@ -9,6 +9,7 @@ class JenaTextSparqlTest extends PHPUnit\Framework\TestCase private $params; protected function setUp() { + putenv("LANGUAGE=en_GB.utf8"); putenv("LC_ALL=en_GB.utf8"); setlocale(LC_ALL, 'en_GB.utf8'); $this->model = new Model(new GlobalConfig('/../tests/jenatestconfig.ttl')); diff --git a/tests/ModelTest.php b/tests/ModelTest.php index 28b2b4ba3..402adea2a 100644 --- a/tests/ModelTest.php +++ b/tests/ModelTest.php @@ -6,6 +6,7 @@ class ModelTest extends PHPUnit\Framework\TestCase private $model; protected function setUp() { + putenv("LANGUAGE=en_GB.utf8"); putenv("LC_ALL=en_GB.utf8"); setlocale(LC_ALL, 'en_GB.utf8'); $this->model = new Model(new GlobalConfig('/../tests/testconfig.ttl')); diff --git a/tests/RequestTest.php b/tests/RequestTest.php index a8e02dbe3..9c3df3948 100644 --- a/tests/RequestTest.php +++ b/tests/RequestTest.php @@ -6,6 +6,7 @@ class RequestTest extends PHPUnit\Framework\TestCase private $request; protected function setUp() { + putenv("LANGUAGE=en_GB.utf8"); putenv("LC_ALL=en_GB.utf8"); setlocale(LC_ALL, 'en_GB.utf8'); bindtextdomain('skosmos', 'resource/translations'); diff --git a/tests/RestControllerTest.php b/tests/RestControllerTest.php index f7d6f30b7..eb8793bfb 100644 --- a/tests/RestControllerTest.php +++ b/tests/RestControllerTest.php @@ -8,6 +8,7 @@ class RestControllerTest extends \PHPUnit\Framework\TestCase { protected function setUp() { + putenv("LANGUAGE=en_GB.utf8"); putenv("LC_ALL=en_GB.utf8"); setlocale(LC_ALL, 'en_GB.utf8'); bindtextdomain('skosmos', 'resource/translations'); @@ -60,4 +61,4 @@ public function testSearchJsonLdWithAdditionalFields() { $this->assertJsonStringEqualsJsonString('{"@context":{"skos":"http:\/\/www.w3.org\/2004\/02\/skos\/core#","isothes":"http:\/\/purl.org\/iso25964\/skos-thes#","onki":"http:\/\/schema.onki.fi\/onki#","uri":"@id","type":"@type","results":{"@id":"onki:results","@container":"@list"},"prefLabel":"skos:prefLabel","altLabel":"skos:altLabel","hiddenLabel":"skos:hiddenLabel","broader":"skos:broader","relatedMatch":"skos:relatedMatch"},"uri":"","results":[{"uri":"http:\/\/www.skosmos.skos\/test\/ta117","type":["skos:Concept","meta:TestClass"],"broader":[{"uri":"http:\/\/www.skosmos.skos\/test\/ta1"}],"relatedMatch":[{"uri":"http:\/\/www.skosmos.skos\/test\/ta115"}],"prefLabel":"3D Bass","lang":"en","vocab":"test"},{"uri":"http:\/\/www.skosmos.skos\/test\/ta116","type":["skos:Concept","meta:TestClass"],"broader":[{"uri":"http:\/\/www.skosmos.skos\/test\/ta1"}],"prefLabel":"Bass","lang":"en","vocab":"test"},{"uri":"http:\/\/www.skosmos.skos\/test\/ta122","type":["skos:Concept","meta:TestClass"],"broader":[{"uri":"http:\/\/www.skosmos.skos\/test\/ta116"}],"prefLabel":"Black sea bass","lang":"en","vocab":"test"}]}', $out); } -} \ No newline at end of file +} diff --git a/tests/VocabularyCategoryTest.php b/tests/VocabularyCategoryTest.php index 0abdfc57f..10ac7cdb2 100644 --- a/tests/VocabularyCategoryTest.php +++ b/tests/VocabularyCategoryTest.php @@ -6,6 +6,7 @@ class VocabularyCategoryTest extends PHPUnit\Framework\TestCase private $mockres; protected function setUp() { + putenv("LANGUAGE=en_GB.utf8"); putenv("LC_ALL=en_GB.utf8"); setlocale(LC_ALL, 'en_GB.utf8'); $this->model = new Model(new GlobalConfig('/../tests/testconfig.ttl')); diff --git a/tests/VocabularyConfigTest.php b/tests/VocabularyConfigTest.php index 87199861e..45d20db01 100644 --- a/tests/VocabularyConfigTest.php +++ b/tests/VocabularyConfigTest.php @@ -10,6 +10,7 @@ class VocabularyConfigTest extends PHPUnit\Framework\TestCase * @throws Exception */ protected function setUp() { + putenv("LANGUAGE=en_GB.utf8"); putenv("LC_ALL=en_GB.utf8"); setlocale(LC_ALL, 'en_GB.utf8'); $this->model = new Model(new GlobalConfig('/../tests/testconfig.ttl')); diff --git a/tests/VocabularyTest.php b/tests/VocabularyTest.php index e54b67d00..7acb60d2e 100644 --- a/tests/VocabularyTest.php +++ b/tests/VocabularyTest.php @@ -8,6 +8,7 @@ class VocabularyTest extends \PHPUnit\Framework\TestCase private $model; protected function setUp() { + putenv("LANGUAGE=en_GB.utf8"); putenv("LC_ALL=en_GB.utf8"); setlocale(LC_ALL, 'en_GB.utf8'); $this->model = new Model(new GlobalConfig('/../tests/testconfig.ttl'));