-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add methods to prepend words with prepositional
- Loading branch information
Showing
5 changed files
with
149 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?php | ||
namespace morphos\test\Russian; | ||
|
||
require __DIR__.'/../../vendor/autoload.php'; | ||
|
||
use morphos\Gender; | ||
use morphos\NumeralGenerator; | ||
use morphos\Russian\Cases; | ||
use morphos\Russian\CardinalNumeralGenerator; | ||
use morphos\Russian\RussianLanguage; | ||
|
||
class RussianLanguageTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
/** | ||
* @dataProvider verbsProvider() | ||
*/ | ||
public function testVerb($verb, $gender, $correctVerb) | ||
{ | ||
$this->assertEquals($correctVerb, \morphos\Russian\RussianLanguage::verb($verb, $gender)); | ||
} | ||
|
||
public function verbsProvider() | ||
{ | ||
return | ||
[ | ||
['попал', Gender::MALE, 'попал'], | ||
['попал', Gender::FEMALE, 'попала'], | ||
['попался', Gender::MALE, 'попался'], | ||
['попался', Gender::FEMALE, 'попалась'], | ||
]; | ||
} | ||
|
||
public function testIn() | ||
{ | ||
$this->assertEquals('в море', RussianLanguage::in('море')); | ||
$this->assertEquals('во Владивостоке', RussianLanguage::in('Владивостоке')); | ||
} | ||
|
||
public function testWith() | ||
{ | ||
$this->assertEquals('с пола', RussianLanguage::with('пола')); | ||
$this->assertEquals('со шкафа', RussianLanguage::with('шкафа')); | ||
$this->assertEquals('со щами', RussianLanguage::with('щами')); | ||
} | ||
|
||
public function testAbout() | ||
{ | ||
$this->assertEquals('о материи', RussianLanguage::about('материи')); | ||
$this->assertEquals('об одном', RussianLanguage::about('одном')); | ||
$this->assertEquals('обо всём', RussianLanguage::about('всём')); | ||
} | ||
} |