Skip to content

Commit

Permalink
Improves keyword tests.
Browse files Browse the repository at this point in the history
Signed-off-by: Mior Muhammad Zaki <[email protected]>
  • Loading branch information
crynobone committed Apr 29, 2018
1 parent fcbe23d commit e73760b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/KeywordTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,17 @@ public function it_can_be_used()
$this->assertEquals('Hello World', $stub1->getValue());
$this->assertEquals(1, $stub1->searchIn(['foo', 'hello-world']));
$this->assertFalse($stub1->searchIn(['foo', 'bar']));
$this->assertTrue($stub1->hasIn(['foo' => 'Foobar', 'hello-world' => 'Hello World']));
$this->assertFalse($stub1->hasIn(['foo' => 'Foo', 'bar' => 'Bar']));

$stub2 = Keyword::make(5);

$this->assertNull($stub2->getSlug());
$this->assertEmpty((string) $stub2);
$this->assertEquals(5, $stub2->getValue());
$this->assertEquals(4, $stub2->searchIn(['hello', 'world', 'foo', 'bar', 5, 'foobar']));
$this->assertTrue($stub2->hasIn(['foo' => 'Foobar', 5 => 'Hello World']));
$this->assertFalse($stub2->hasIn(['foo' => 'Foo', 'bar' => 'Bar']));
}

/** @test */
Expand All @@ -34,5 +38,7 @@ public function it_can_return_self_when_given_same_type()
$stub = Keyword::make($keyword);

$this->assertEquals($keyword, $stub);
$this->assertTrue($stub->hasIn(['foo' => 'Foobar', 'hello' => 'Hello World']));
$this->assertFalse($stub->hasIn(['foo' => 'Foo', 'bar' => 'Bar']));
}
}

0 comments on commit e73760b

Please sign in to comment.