| @@ 26-36 (lines=11) @@ | ||
| 23 | $this->assertEquals($overlap, $needles, "Assert that array contains all values specified"); |
|
| 24 | } |
|
| 25 | ||
| 26 | public function testCheckWords() |
|
| 27 | { |
|
| 28 | $provider = new HunSpellProvider(); |
|
| 29 | $result = $provider->checkWords('en_US', array('collor', 'one', 'twoo', 'three')); |
|
| 30 | $this->assertArrayContains( |
|
| 31 | array('collor', 'twoo'), |
|
| 32 | $result |
|
| 33 | ); |
|
| 34 | $result = $provider->checkWords('en_US', array('basketball')); |
|
| 35 | $this->assertEmpty($result); |
|
| 36 | } |
|
| 37 | ||
| 38 | public function testGetSuggestions() |
|
| 39 | { |
|
| @@ 38-48 (lines=11) @@ | ||
| 35 | $this->assertEmpty($result); |
|
| 36 | } |
|
| 37 | ||
| 38 | public function testGetSuggestions() |
|
| 39 | { |
|
| 40 | $provider = new HunSpellProvider(); |
|
| 41 | $result = $provider->getSuggestions('en_US', 'collor'); |
|
| 42 | $this->assertArrayContains( |
|
| 43 | array('color', 'collar', 'coll or', 'coll-or', 'collator'), |
|
| 44 | $result |
|
| 45 | ); |
|
| 46 | $result = $provider->getSuggestions('en_US', 'basketball'); |
|
| 47 | $this->assertEmpty($result); |
|
| 48 | } |
|
| 49 | } |
|
| 50 | ||