Skip to content

Commit

Permalink
Migrate tests
Browse files Browse the repository at this point in the history
  • Loading branch information
iamgergo committed Mar 9, 2020
1 parent cbd5154 commit b9982ac
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 23 deletions.
19 changes: 1 addition & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,6 @@ If you have any question how the package works, we suggest to read this post:

You can install the package with composer, running the `composer require thepinecode/blade-filters` command.

### Laravel 5.5 and up

If you are using version 5.5 and up, there is nothing else to do.
Since the package supports autodiscovery, Laravel will register the service provider automatically behind the scenes.

#### Disable the autodiscovery for the package

In some cases you may disable autodiscovery for this package.
You can add the provider class to the `dont-discover` array to disable it.

Then you need to register it manually again.

### Laravel 5.4 and below

You have to register the service provider manually.
Go to the `config/app.php` file and add the `Pine\BladeFilters\BladeFiltersServiceProvider::class` to the providers array.

## Using the filters

You can use the filters in any of your blade templates.
Expand Down Expand Up @@ -202,7 +185,7 @@ BladeFilters::macro('filterName', function ($value, $param1 = 'default', $param2

### Defining custom filters

Since the filters are only methods that are defined in the `Str` facade and the `BladeFilters` class, to create filters,
Since the filters are only methods that are defined in the `Str` facade and the `BladeFilters` class, to create filters,
you need to create a macro in a service provider's `boot()` method.

```php
Expand Down
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@
}
},
"require": {
"php" : "^7.0"
"php" : "^7.2.5",
"laravel/framework": "^6.0|^7.0"
},
"require-dev": {
"orchestra/testbench":"~4.5.0"
"orchestra/testbench":"~5.0.0"
},
"extra": {
"laravel": {
Expand Down
6 changes: 3 additions & 3 deletions tests/BladeFiltersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ public function a_string_can_be_wrapped_and_multiline()
{
$this->get('/blade-filters/wrapped')
->assertSee(
'<h1>' . BladeFilters::title('this is a title') . '</h1>'
'<h1>' . BladeFilters::title('this is a title') . '</h1>', false
)->assertSee(
'<a href="' . BladeFilters::slug('this is a link') . '">Link</a>'
'<a href="' . BladeFilters::slug('this is a link') . '">Link</a>', false
);
}

Expand All @@ -76,6 +76,6 @@ public function it_throws_exception_when_missing_filter()
public function at_curly_brace_js_syntax_ignored()
{
$this->get('/blade-filters/ignore-js')
->assertSee('<h1>{{ val.title | title }}</h1>');
->assertSee('<h1>{{ val.title | title }}</h1>', false);
}
}

0 comments on commit b9982ac

Please sign in to comment.