-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from tattersoftware/cleanup
Cleanup
- Loading branch information
Showing
7 changed files
with
147 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of Tatter Alerts. | ||
* | ||
* (c) 2021 Tatter Software | ||
* | ||
* For the full copyright and license information, please view | ||
* the LICENSE file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Tests\Support; | ||
|
||
use CodeIgniter\Test\CIUnitTestCase; | ||
use Config\Services; | ||
|
||
abstract class AlertsTestCase extends CIUnitTestCase | ||
{ | ||
protected function setUp(): void | ||
{ | ||
Services::reset(); | ||
|
||
parent::setUp(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of Tatter Alerts. | ||
* | ||
* (c) 2021 Tatter Software | ||
* | ||
* For the full copyright and license information, please view | ||
* the LICENSE file that was distributed with this source code. | ||
*/ | ||
|
||
use Tatter\Alerts\Alerts; | ||
use Tests\Support\AlertsTestCase; | ||
|
||
/** | ||
* @internal | ||
*/ | ||
final class LibraryTest extends AlertsTestCase | ||
{ | ||
public function testAdd() | ||
{ | ||
$expected = [ | ||
[ | ||
'class' => 'fruit', | ||
'text' => 'banana', | ||
], | ||
[ | ||
'class' => 'candy', | ||
'text' => 'snickers', | ||
], | ||
]; | ||
|
||
service('alerts')->add('fruit', 'banana'); | ||
service('alerts')->add('candy', 'snickers'); | ||
|
||
$this->assertSame($expected, session('alerts-queue')); | ||
} | ||
|
||
public function testCss() | ||
{ | ||
$expected = view('Tatter\Alerts\Views\css', ['prefix' => 'alerts-']); | ||
$result = service('alerts')->css(); | ||
|
||
$this->assertSame($expected, $result); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters