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

Tagging for Laravel 5.8 and Laravel 6.x tests fix. #50

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@ Then, make sure the Stylist service provider is made available to your applicati

'FloatingPoint\Stylist\StylistServiceProvider',

## Version Compatibility

Laravel | Stylist
:---------|:----------
5.5 | <1.0
5.8 | 1.1
6.x | 2.x
7.x | 3.x


You're now ready to go!

## Setting up a theme
Expand Down
11 changes: 5 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,13 @@
}
],
"require": {
"php": "^7.0",
"laravelcollective/html": "~5.5",
"illuminate/support": "~5.5"
"php": "^7.1",
"illuminate/support": "^6.0|^7.0",
"laravel/framework": "^6.0|^7.0",
"laravelcollective/html": "^6.0|^7.0"
},
"require-dev": {
"mockery/mockery": "^0.9.5",
"orchestra/testbench": "~3.0",
"phpunit/phpunit": "~6.0"
"orchestra/testbench": "^4.0|^5.0"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"

>
<testsuites>
<testsuite name="Unit">
Expand Down
8 changes: 4 additions & 4 deletions tests/Html/ThemeHtmlBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,28 +21,28 @@ public function testScriptUrlCreation()
{
$script = $this->builder->script('script.js');

$this->assertContains('/themes/parent-theme/script.js', (string) $script);
$this->assertStringContainsString('/themes/parent-theme/script.js', (string) $script);
}

public function testStyleUrlCreation()
{
$style = $this->builder->script('css/app.css');

$this->assertContains('/themes/parent-theme/css/app.css', (string) $style);
$this->assertStringContainsString('/themes/parent-theme/css/app.css', (string) $style);
}

public function testImageUrlCreation()
{
$image = $this->builder->image('images/my-image.png');

$this->assertContains('/themes/parent-theme/images/my-image.png', (string) $image);
$this->assertStringContainsString('/themes/parent-theme/images/my-image.png', (string) $image);
}

public function testHtmlLinkAssetCreation()
{
$flashLink = $this->builder->linkAsset('swf/video.swf');

$this->assertContains('/themes/parent-theme/swf/video.swf', (string) $flashLink);
$this->assertStringContainsString('/themes/parent-theme/swf/video.swf', (string) $flashLink);
}

public function testAssetUrlResponse()
Expand Down
4 changes: 2 additions & 2 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@

class TestCase extends \Orchestra\Testbench\TestCase
{
public function tearDown()
public function tearDown(): void
{
parent::tearDown();
m::close();
}

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

Expand Down
5 changes: 4 additions & 1 deletion tests/Theme/JsonTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
namespace Tests\Theme;

use FloatingPoint\Stylist\Theme\Json;
use FloatingPoint\Stylist\Theme\Exceptions\ThemeJsonNotFoundException;

class JsonTest extends \Tests\TestCase
{
Expand All @@ -28,10 +29,12 @@ public function testJsonAttributeRetrieval()
}

/**
* @expectedException FloatingPoint\Stylist\Theme\Exceptions\ThemeJsonNotFoundException
* @expectException FloatingPoint\Stylist\Theme\Exceptions\ThemeJsonNotFoundException
*/
public function testThemeFileMissing()
{
$this->expectException(ThemeJsonNotFoundException::class);

$json = new Json('path/that/doesnt/exist');

$json->getJson();
Expand Down
4 changes: 3 additions & 1 deletion tests/Theme/StylistTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
use FloatingPoint\Stylist\Theme\Loader;
use FloatingPoint\Stylist\Theme\Stylist;
use FloatingPoint\Stylist\Theme\Theme;
use FloatingPoint\Stylist\Theme\Exceptions\ThemeNotFoundException;

class StylistTest extends \Tests\TestCase
{
Expand Down Expand Up @@ -66,10 +67,11 @@ public function testMultiplePathRegistrations()
}

/**
* @expectedException FloatingPoint\Stylist\Theme\Exceptions\ThemeNotFoundException
* @expectException FloatingPoint\Stylist\Theme\Exceptions\ThemeNotFoundException
*/
public function testInvalidTheme()
{
$this->expectException(ThemeNotFoundException::class);
$stylist = new Stylist(new Loader, $this->app);
$stylist->get('invalidtheme');
}
Expand Down