3 changed files with 0 additions and 101 deletions
@ -1,42 +0,0 @@ |
|||||||
<?php |
|
||||||
|
|
||||||
namespace Drupal\Tests\olivesimagined\Functional\Update; |
|
||||||
|
|
||||||
use Drupal\FunctionalTests\Update\UpdatePathTestBase; |
|
||||||
|
|
||||||
/** |
|
||||||
* Tests the update path for Olivesimagined. |
|
||||||
* |
|
||||||
* @group Update |
|
||||||
*/ |
|
||||||
class OlivesimaginedPostUpdateTest extends UpdatePathTestBase { |
|
||||||
|
|
||||||
/** |
|
||||||
* {@inheritdoc} |
|
||||||
*/ |
|
||||||
protected $defaultTheme = 'stark'; |
|
||||||
|
|
||||||
/** |
|
||||||
* {@inheritdoc} |
|
||||||
*/ |
|
||||||
protected function setDatabaseDumpFiles() { |
|
||||||
$this->databaseDumpFiles = [ |
|
||||||
__DIR__ . '/../../../../../../modules/system/tests/fixtures/update/drupal-9.4.0.filled.standard.php.gz', |
|
||||||
]; |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* Tests update hook setting base primary color. |
|
||||||
*/ |
|
||||||
public function testOlivesimaginedPrimaryColorUpdate() { |
|
||||||
$config = $this->config('olivesimagined.settings'); |
|
||||||
$this->assertEmpty($config->get('base_primary_color')); |
|
||||||
|
|
||||||
// Run updates. |
|
||||||
$this->runUpdates(); |
|
||||||
|
|
||||||
$config = $this->config('olivesimagined.settings'); |
|
||||||
$this->assertSame('#1b9ae4', $config->get('base_primary_color')); |
|
||||||
} |
|
||||||
|
|
||||||
} |
|
||||||
@ -1,52 +0,0 @@ |
|||||||
<?php |
|
||||||
|
|
||||||
namespace Drupal\Tests\olivesimagined\Unit; |
|
||||||
|
|
||||||
use Drupal\Tests\UnitTestCase; |
|
||||||
|
|
||||||
/** |
|
||||||
* Tests the _olivesimagined_hex_to_hsl() function. |
|
||||||
* |
|
||||||
* @group olivesimagined |
|
||||||
*/ |
|
||||||
final class OlivesimaginedHexToHslTest extends UnitTestCase { |
|
||||||
|
|
||||||
/** |
|
||||||
* {@inheritdoc} |
|
||||||
*/ |
|
||||||
public function setUp(): void { |
|
||||||
parent::setUp(); |
|
||||||
require_once __DIR__ . '/../../../olivesimagined.theme'; |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* Tests hex to HSL conversion. |
|
||||||
* |
|
||||||
* @param string $hex |
|
||||||
* The hex code. |
|
||||||
* @param array $expected_hsl |
|
||||||
* The expected HSL values. |
|
||||||
* |
|
||||||
* @dataProvider hexCodes |
|
||||||
*/ |
|
||||||
public function testHexToHsl(string $hex, array $expected_hsl): void { |
|
||||||
self::assertEquals($expected_hsl, _olivesimagined_hex_to_hsl($hex)); |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* Data provider of hex codes and HSL values. |
|
||||||
* |
|
||||||
* @return array[] |
|
||||||
* The test data. |
|
||||||
*/ |
|
||||||
public function hexCodes(): array { |
|
||||||
return [ |
|
||||||
'Blue Lagoon' => ['#1b9ae4', [202, 79, 50]], |
|
||||||
'Firehouse' => ['#a30f0f', [0, 83, 35]], |
|
||||||
'Ice' => ['#57919e', [191, 29, 48]], |
|
||||||
'Plum' => ['#7a4587', [288, 32, 40]], |
|
||||||
'Slate' => ['#47625b', [164, 16, 33]], |
|
||||||
]; |
|
||||||
} |
|
||||||
|
|
||||||
} |
|
||||||
Loading…
Reference in new issue