Skip to content

Commit

Permalink
Spark: Update to latest Lunr.Halo
Browse files Browse the repository at this point in the history
  • Loading branch information
pprkut committed Jan 31, 2025
1 parent 5c5d3ee commit 293335f
Show file tree
Hide file tree
Showing 23 changed files with 69 additions and 69 deletions.
2 changes: 1 addition & 1 deletion src/Lunr/Spark/Contentful/Tests/ApiBaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*
* @covers Lunr\Spark\Contentful\Api
*/
class ApiBaseTest extends ApiTest
class ApiBaseTest extends ApiTestCase
{

use PsrLoggerTestTrait;
Expand Down
18 changes: 9 additions & 9 deletions src/Lunr/Spark/Contentful/Tests/ApiGetBaseUrlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
* @covers Lunr\Spark\Contentful\Api
*/
class ApiGetBaseUrlTest extends ApiTest
class ApiGetBaseUrlTest extends ApiTestCase
{

/**
Expand All @@ -25,7 +25,7 @@ class ApiGetBaseUrlTest extends ApiTest
*/
public function testGetBaseUrlWithoutValues(): void
{
$method = $this->get_accessible_reflection_method('get_base_url');
$method = $this->getReflectionMethod('get_base_url');
$result = $method->invoke($this->class);

$this->assertSame('https://www.contentful.com', $result);
Expand All @@ -38,9 +38,9 @@ public function testGetBaseUrlWithoutValues(): void
*/
public function testGetBaseUrlWithOnlySpace(): void
{
$this->set_reflection_property_value('space', '5p4c31D');
$this->setReflectionPropertyValue('space', '5p4c31D');

$method = $this->get_accessible_reflection_method('get_base_url');
$method = $this->getReflectionMethod('get_base_url');
$result = $method->invoke($this->class);

$this->assertSame('https://www.contentful.com/spaces/5p4c31D', $result);
Expand All @@ -53,9 +53,9 @@ public function testGetBaseUrlWithOnlySpace(): void
*/
public function testGetBaseUrlWithOnlyEnvironment(): void
{
$this->set_reflection_property_value('environment', 'master');
$this->setReflectionPropertyValue('environment', 'master');

$method = $this->get_accessible_reflection_method('get_base_url');
$method = $this->getReflectionMethod('get_base_url');
$result = $method->invoke($this->class);

$this->assertSame('https://www.contentful.com/environments/master', $result);
Expand All @@ -68,10 +68,10 @@ public function testGetBaseUrlWithOnlyEnvironment(): void
*/
public function testGetBaseUrlWithAllValues(): void
{
$this->set_reflection_property_value('space', '5p4c31D');
$this->set_reflection_property_value('environment', 'master');
$this->setReflectionPropertyValue('space', '5p4c31D');
$this->setReflectionPropertyValue('environment', 'master');

$method = $this->get_accessible_reflection_method('get_base_url');
$method = $this->getReflectionMethod('get_base_url');
$result = $method->invoke($this->class);

$this->assertSame('https://www.contentful.com/spaces/5p4c31D/environments/master', $result);
Expand Down
2 changes: 1 addition & 1 deletion src/Lunr/Spark/Contentful/Tests/ApiSetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
* @covers Lunr\Spark\Contentful\Api
*/
class ApiSetTest extends ApiTest
class ApiSetTest extends ApiTestCase
{

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* This file contains the ApiTest class.
* This file contains the ApiTestCase class.
*
* SPDX-FileCopyrightText: Copyright 2015 M2mobi B.V., Amsterdam, The Netherlands
* SPDX-FileCopyrightText: Copyright 2022 Move Agency Group B.V., Zwolle, The Netherlands
Expand All @@ -10,7 +10,7 @@

namespace Lunr\Spark\Contentful\Tests;

use Lunr\Halo\LunrBaseTest;
use Lunr\Halo\LunrBaseTestCase;
use Lunr\Spark\Contentful\Api;
use Psr\Cache\CacheItemInterface;
use Psr\Cache\CacheItemPoolInterface;
Expand All @@ -23,7 +23,7 @@
*
* @covers Lunr\Spark\Contentful\Api
*/
abstract class ApiTest extends LunrBaseTest
abstract class ApiTestCase extends LunrBaseTestCase
{

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Lunr/Spark/Contentful/Tests/DeliveryApiBaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*
* @covers Lunr\Spark\Contentful\DeliveryApi
*/
class DeliveryApiBaseTest extends DeliveryApiTest
class DeliveryApiBaseTest extends DeliveryApiTestCase
{

use PsrLoggerTestTrait;
Expand Down
14 changes: 7 additions & 7 deletions src/Lunr/Spark/Contentful/Tests/DeliveryApiGetAssetsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*
* @covers Lunr\Spark\Contentful\DeliveryApi
*/
class DeliveryApiGetAssetsTest extends DeliveryApiTest
class DeliveryApiGetAssetsTest extends DeliveryApiTestCase
{

/**
Expand All @@ -28,7 +28,7 @@ class DeliveryApiGetAssetsTest extends DeliveryApiTest
*/
public function testGetAssetsWithoutFiltersReturnsEmptyResultOnRequestError(): void
{
$this->set_reflection_property_value('space', '5p4c31D');
$this->setReflectionPropertyValue('space', '5p4c31D');

$this->cache->expects($this->once())
->method('getItem')
Expand Down Expand Up @@ -87,7 +87,7 @@ public function testGetAssetsWithoutFiltersReturnsEmptyResultOnRequestError(): v
*/
public function testGetAssetsWithFiltersReturnsEmptyResultOnRequestError(): void
{
$this->set_reflection_property_value('space', '5p4c31D');
$this->setReflectionPropertyValue('space', '5p4c31D');

$this->cache->expects($this->once())
->method('getItem')
Expand Down Expand Up @@ -146,7 +146,7 @@ public function testGetAssetsWithFiltersReturnsEmptyResultOnRequestError(): void
*/
public function testGetAssetsWithoutFiltersReturnsEmptyResultOnRequestFailure(): void
{
$this->set_reflection_property_value('space', '5p4c31D');
$this->setReflectionPropertyValue('space', '5p4c31D');

$this->cache->expects($this->once())
->method('getItem')
Expand Down Expand Up @@ -193,7 +193,7 @@ public function testGetAssetsWithoutFiltersReturnsEmptyResultOnRequestFailure():
*/
public function testGetAssetsWithFiltersReturnsEmptyResultOnRequestFailure(): void
{
$this->set_reflection_property_value('space', '5p4c31D');
$this->setReflectionPropertyValue('space', '5p4c31D');

$this->cache->expects($this->once())
->method('getItem')
Expand Down Expand Up @@ -240,7 +240,7 @@ public function testGetAssetsWithFiltersReturnsEmptyResultOnRequestFailure(): vo
*/
public function testGetAssetsWithoutFiltersReturnsResultsOnSuccessfulRequest(): void
{
$this->set_reflection_property_value('space', '5p4c31D');
$this->setReflectionPropertyValue('space', '5p4c31D');

$output = [
'param1' => 1,
Expand Down Expand Up @@ -279,7 +279,7 @@ public function testGetAssetsWithoutFiltersReturnsResultsOnSuccessfulRequest():
*/
public function testGetAssetsWithFiltersReturnsResultsOnSuccessfulRequest(): void
{
$this->set_reflection_property_value('space', '5p4c31D');
$this->setReflectionPropertyValue('space', '5p4c31D');

$output = [
'param1' => 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*
* @covers Lunr\Spark\Contentful\DeliveryApi
*/
class DeliveryApiGetEntriesTest extends DeliveryApiTest
class DeliveryApiGetEntriesTest extends DeliveryApiTestCase
{

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*
* @covers Lunr\Spark\Contentful\DeliveryApi
*/
class DeliveryApiGetJsonResultsTest extends DeliveryApiTest
class DeliveryApiGetJsonResultsTest extends DeliveryApiTestCase
{

/**
Expand All @@ -33,7 +33,7 @@ public function testGetJsonResultsMakesGetRequestWithoutParams(): void
->with('http://localhost', [], [])
->willReturn($this->response);

$method = $this->get_accessible_reflection_method('get_json_results');
$method = $this->getReflectionMethod('get_json_results');

$method->invokeArgs($this->class, [ 'http://localhost', [] ]);
}
Expand All @@ -50,7 +50,7 @@ public function testGetJsonResultsMakesGetRequestWithParams(): void
->with('http://localhost', [], [ 'param1' => 1, 'param2' => 2 ])
->willReturn($this->response);

$method = $this->get_accessible_reflection_method('get_json_results');
$method = $this->getReflectionMethod('get_json_results');

$method->invokeArgs($this->class, [ 'http://localhost', [ 'param1' => 1, 'param2' => 2 ] ]);
}
Expand Down Expand Up @@ -86,7 +86,7 @@ public function testGetJsonResultsThrowsErrorIfRequestHadError(): void
->method('warning')
->with('Contentful API Request ({request}) failed with id "{id}": {message}', $context);

$method = $this->get_accessible_reflection_method('get_json_results');
$method = $this->getReflectionMethod('get_json_results');

$method->invokeArgs($this->class, [ 'http://localhost' ]);
}
Expand All @@ -112,7 +112,7 @@ public function testGetJsonResultsThrowsErrorIfRequestFailed(): void
->method('warning')
->with('Contentful API Request ({request}) failed! {message}', $context);

$method = $this->get_accessible_reflection_method('get_json_results');
$method = $this->getReflectionMethod('get_json_results');

$method->invokeArgs($this->class, [ 'http://localhost' ]);
}
Expand All @@ -135,7 +135,7 @@ public function testGetJsonResultsDoesNotThrowErrorIfRequestSuccessful(): void
$this->logger->expects($this->never())
->method('error');

$method = $this->get_accessible_reflection_method('get_json_results');
$method = $this->getReflectionMethod('get_json_results');

$method->invokeArgs($this->class, [ 'http://localhost' ]);
}
Expand Down Expand Up @@ -165,7 +165,7 @@ public function testGetJsonResultsReturnsEmptyResultOnRequestError(): void
$this->response->body = json_encode($output);
$this->response->url = 'http://localhost/url';

$method = $this->get_accessible_reflection_method('get_json_results');
$method = $this->getReflectionMethod('get_json_results');

$value = $method->invokeArgs($this->class, [ 'http://localhost' ]);

Expand Down Expand Up @@ -194,7 +194,7 @@ public function testGetJsonResultsReturnsResultsOnSuccessfulRequest(): void
$this->response->status_code = 200;
$this->response->body = json_encode($output);

$method = $this->get_accessible_reflection_method('get_json_results');
$method = $this->getReflectionMethod('get_json_results');

$this->assertEquals([ 'param1' => 1, 'param2' => 2 ], $method->invokeArgs($this->class, [ 'http://localhost' ]));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* This file contains the DeliveryApiTest class.
* This file contains the DeliveryApiTestCase class.
*
* SPDX-FileCopyrightText: Copyright 2015 M2mobi B.V., Amsterdam, The Netherlands
* SPDX-FileCopyrightText: Copyright 2022 Move Agency Group B.V., Zwolle, The Netherlands
Expand All @@ -10,7 +10,7 @@

namespace Lunr\Spark\Contentful\Tests;

use Lunr\Halo\LunrBaseTest;
use Lunr\Halo\LunrBaseTestCase;
use Lunr\Spark\Contentful\DeliveryApi;
use Psr\Cache\CacheItemInterface;
use Psr\Cache\CacheItemPoolInterface;
Expand All @@ -23,7 +23,7 @@
*
* @covers Lunr\Spark\Contentful\DeliveryApi
*/
abstract class DeliveryApiTest extends LunrBaseTest
abstract class DeliveryApiTestCase extends LunrBaseTestCase
{

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Lunr/Spark/Contentful/Tests/ManagementApiBaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*
* @covers Lunr\Spark\Contentful\ManagementApi
*/
class ManagementApiBaseTest extends ManagementApiTest
class ManagementApiBaseTest extends ManagementApiTestCase
{

use PsrLoggerTestTrait;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*
* @covers Lunr\Spark\Contentful\ManagementApi
*/
class ManagementApiCreateEntryTest extends ManagementApiTest
class ManagementApiCreateEntryTest extends ManagementApiTestCase
{

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*
* @covers Lunr\Spark\Contentful\ManagementApi
*/
class ManagementApiGetEntryTest extends ManagementApiTest
class ManagementApiGetEntryTest extends ManagementApiTestCase
{

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*
* @covers Lunr\Spark\Contentful\ManagementApi
*/
class ManagementApiPublishEntryTest extends ManagementApiTest
class ManagementApiPublishEntryTest extends ManagementApiTestCase
{

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* This file contains the ManagementApiTest class.
* This file contains the ManagementApiTestCase class.
*
* SPDX-FileCopyrightText: Copyright 2015 M2mobi B.V., Amsterdam, The Netherlands
* SPDX-FileCopyrightText: Copyright 2022 Move Agency Group B.V., Zwolle, The Netherlands
Expand All @@ -10,7 +10,7 @@

namespace Lunr\Spark\Contentful\Tests;

use Lunr\Halo\LunrBaseTest;
use Lunr\Halo\LunrBaseTestCase;
use Lunr\Spark\Contentful\ManagementApi;
use Psr\Cache\CacheItemInterface;
use Psr\Cache\CacheItemPoolInterface;
Expand All @@ -23,7 +23,7 @@
*
* @covers Lunr\Spark\Contentful\ManagementApi
*/
abstract class ManagementApiTest extends LunrBaseTest
abstract class ManagementApiTestCase extends LunrBaseTestCase
{

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*
* @covers Lunr\Spark\Contentful\ManagementApi
*/
class ManagementApiUnpublishEntryTest extends ManagementApiTest
class ManagementApiUnpublishEntryTest extends ManagementApiTestCase
{

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* This file contains the ManagementApiUpdateEntryTest class.
* This file contains the ManagementApiUpdateEntryTestCase class.
*
* SPDX-FileCopyrightText: Copyright 2015 M2mobi B.V., Amsterdam, The Netherlands
* SPDX-FileCopyrightText: Copyright 2022 Move Agency Group B.V., Zwolle, The Netherlands
Expand All @@ -18,7 +18,7 @@
*
* @covers Lunr\Spark\Contentful\ManagementApi
*/
class ManagementApiUpdateEntryTest extends ManagementApiTest
class ManagementApiUpdateEntryTestCase extends ManagementApiTest
{

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Lunr/Spark/Contentful/Tests/PreviewApiBaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*
* @covers Lunr\Spark\Contentful\PreviewApi
*/
class PreviewApiBaseTest extends PreviewApiTest
class PreviewApiBaseTest extends PreviewApiTestCase
{

use PsrLoggerTestTrait;
Expand Down
Loading

0 comments on commit 293335f

Please sign in to comment.