Skip to content

Commit

Permalink
UI/Button: withUnavailableAction accepts parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
nhaagen committed Oct 6, 2023
1 parent d837035 commit bca0c0c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/UI/Component/Button/Button.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

declare(strict_types=1);

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
Expand All @@ -18,6 +16,8 @@
*
*********************************************************************/

declare(strict_types=1);

namespace ILIAS\UI\Component\Button;

use ILIAS\UI\Component\Clickable;
Expand Down
4 changes: 2 additions & 2 deletions src/UI/Implementation/Component/Button/Button.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

declare(strict_types=1);

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
Expand All @@ -18,6 +16,8 @@
*
*********************************************************************/

declare(strict_types=1);

namespace ILIAS\UI\Implementation\Component\Button;

use ILIAS\UI\Component as C;
Expand Down
7 changes: 5 additions & 2 deletions tests/UI/Component/Button/ButtonTest.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

declare(strict_types=1);

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
Expand All @@ -18,6 +16,8 @@
*
*********************************************************************/

declare(strict_types=1);

require_once(__DIR__ . "/../../../../libs/composer/vendor/autoload.php");
require_once(__DIR__ . "/../../Base.php");

Expand Down Expand Up @@ -146,6 +146,9 @@ public function test_button_deactivation(string $factory_method): void

$this->assertFalse($b->isActive());
$this->assertEquals("http://www.ilias.de", $b->getAction());

$b = $b->withUnavailableAction(false);
$this->assertTrue($b->isActive());
}

/**
Expand Down

0 comments on commit bca0c0c

Please sign in to comment.