Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 2.0 #20

Draft
wants to merge 29 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
32aa8cc
Update .gitignore
dsbilling Dec 29, 2023
37147b0
Added dependabot
dsbilling Dec 29, 2023
c3588d4
Updated core files
dsbilling Dec 29, 2023
f84306c
Create release.yml
dsbilling Dec 29, 2023
fdbf12c
Improved readme
dsbilling Dec 29, 2023
da2435b
Added compatibility table
dsbilling Dec 29, 2023
2e90e22
Drop older laravel versions and bump packages
dsbilling Dec 29, 2023
efaf205
Added php cs fixer
dsbilling Dec 29, 2023
dea3723
Update composer.json
dsbilling Dec 29, 2023
b046fff
Added typehinting
dsbilling Dec 29, 2023
de7c9a4
Add Pest dependencies
laravel-shift Dec 29, 2023
fe6ecc2
Add base Pest file
laravel-shift Dec 29, 2023
56fec8b
Convert test cases
laravel-shift Dec 29, 2023
d10454e
Adopt expectation API
laravel-shift Dec 29, 2023
596eb30
Optimize uses
laravel-shift Dec 29, 2023
e7045ad
Use Pest test runner
laravel-shift Dec 29, 2023
1ea7723
Remove PHP 8.0 support
dsbilling Dec 29, 2023
354456b
Delete .travis.yml
dsbilling Dec 29, 2023
6836904
Updated coverage command
dsbilling Dec 29, 2023
b5ace8f
Converted expect into chain
dsbilling Dec 29, 2023
c79527d
Update composer.json
dsbilling Dec 29, 2023
91b75dd
Merge pull request #1 from dsbilling/shift-107205
dsbilling Dec 29, 2023
5c76405
Create phpstan.yml
dsbilling Dec 29, 2023
2289ee7
Create run-tests.yml
dsbilling Dec 29, 2023
840dcc8
Delete .scrutinizer.yml
dsbilling Dec 29, 2023
370875f
Delete .styleci.yml
dsbilling Dec 29, 2023
bd11998
Update composer.json
dsbilling Dec 29, 2023
a8e92b7
Merge branch 'master' into release-2.0
dsbilling May 21, 2024
512cb95
Update run-tests.yml
dsbilling May 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Convert test cases
  • Loading branch information
laravel-shift committed Dec 29, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 56fec8b8489ba038d5cc46f34eb77ea7cd5475b9
38 changes: 16 additions & 22 deletions tests/EnvironmentGeneratorTest.php
Original file line number Diff line number Diff line change
@@ -1,33 +1,27 @@
<?php

namespace BeyondCode\LaravelFavicon\Tests;

use BeyondCode\LaravelFavicon\FaviconServiceProvider;

class EnvironmentGeneratorTest extends \Orchestra\Testbench\TestCase
{
protected function getPackageProviders($app)
{
return [FaviconServiceProvider::class];
}
uses(Orchestra\Testbench\TestCase::class);

/** @test */
public function the_helper_returns_the_icon_file_for_invalid_environments()
{
$this->app['config']['app.env'] = 'production';
test('the helper returns the icon file for invalid environments', function () {
app()['config']['app.env'] = 'production';

$icon = favicon('some_icon');
$icon = favicon('some_icon');

$this->assertSame('some_icon', $icon);
}
$this->assertSame('some_icon', $icon);
});

/** @test */
public function the_helper_returns_the_icon_route_for_valid_environments()
{
$this->app['config']['app.env'] = 'local';
test('the helper returns the icon route for valid environments', function () {
app()['config']['app.env'] = 'local';

$icon = favicon('some_icon');
$icon = favicon('some_icon');

$this->assertSame('/laravel-favicon/some_icon', $icon);
}
$this->assertSame('/laravel-favicon/some_icon', $icon);
});

// Helpers
function getPackageProviders($app)
{
return [FaviconServiceProvider::class];
}
70 changes: 28 additions & 42 deletions tests/FaviconTest.php
Original file line number Diff line number Diff line change
@@ -1,53 +1,39 @@
<?php

namespace BeyondCode\LaravelFavicon\Tests;

use BeyondCode\LaravelFavicon\Favicon;
use BeyondCode\LaravelFavicon\FaviconServiceProvider;

class FaviconTest extends \Orchestra\Testbench\TestCase
{
/** @var Favicon */
protected $favicon;

public function setUp(): void
{
parent::setUp();

$this->favicon = new Favicon([
'enabled_environments' => [
'local' => [
'text' => 'DEV',
'color' => '#000000',
'background_color' => '#ffffff',
],
uses(Orchestra\Testbench\TestCase::class);
beforeEach(function () {
$this->favicon = new Favicon([
'enabled_environments' => [
'local' => [
'text' => 'DEV',
'color' => '#000000',
'background_color' => '#ffffff',
],
]);
}
],
]);
});


protected function getPackageProviders($app)
{
return [FaviconServiceProvider::class];
}
it('returns environment specific color', function () {
$this->assertNull($this->favicon->getFaviconColor('unknown'));
$this->assertSame('#000000', $this->favicon->getFaviconColor('local'));
});

/** @test */
public function it_returns_environment_specific_color()
{
$this->assertNull($this->favicon->getFaviconColor('unknown'));
$this->assertSame('#000000', $this->favicon->getFaviconColor('local'));
}
it('returns environment specific text', function () {
$this->assertNull($this->favicon->getFaviconText('unknown'));
$this->assertSame('DEV', $this->favicon->getFaviconText('local'));
});

/** @test */
public function it_returns_environment_specific_text()
{
$this->assertNull($this->favicon->getFaviconText('unknown'));
$this->assertSame('DEV', $this->favicon->getFaviconText('local'));
}
it('returns environment specific background color', function () {
$this->assertNull($this->favicon->getFaviconBackgroundColor('unknown'));
$this->assertSame('#ffffff', $this->favicon->getFaviconBackgroundColor('local'));
});

/** @test */
public function it_returns_environment_specific_background_color()
{
$this->assertNull($this->favicon->getFaviconBackgroundColor('unknown'));
$this->assertSame('#ffffff', $this->favicon->getFaviconBackgroundColor('local'));
}
// Helpers
function getPackageProviders($app)
{
return [FaviconServiceProvider::class];
}