Skip to content

Commit

Permalink
Merge branch '1.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
crynobone committed Nov 4, 2019
2 parents 685ec4a + f7de390 commit c1f410f
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions tests/Unit/Value/KeywordTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php

namespace Laravie\QueryFilter\Tests\Unit\Value;

use PHPUnit\Framework\TestCase;
use Laravie\QueryFilter\Value\Keyword;

class KeywordTest extends TestCase
{
/** @test */
public function it_can_generate_keywords()
{
$this->assertSame([
'Hello',
'Hello%',
'%Hello',
'%Hello%',
], (new Keyword('Hello'))->all());
}

/** @test */
public function it_can_generate_lowercased_keywords()
{
$this->assertSame([
'hello',
'hello%',
'%hello',
'%hello%',
], (new Keyword('Hello'))->allLowerCased());
}

/** @test */
public function it_can_generate_wildcard_keywords()
{
$this->assertSame([
'He%world',
], (new Keyword('He%world'))->all());


$this->assertSame([
'He%world',
], (new Keyword('He*world'))->all());
}
}

0 comments on commit c1f410f

Please sign in to comment.