49 lines
1.4 KiB
PHP
49 lines
1.4 KiB
PHP
<?php
|
|
namespace Tests\Unit;
|
|
|
|
use Tests\TestCase;
|
|
use App\Handlers\LexiconEntryTrait;
|
|
|
|
/**
|
|
* LexicalEntryTraitTest.php
|
|
*
|
|
* @author: Leonard Smith <leonard@acornwebconsultants.com>
|
|
* Date: 5/19/21
|
|
* Time: 6:10 AM
|
|
*/
|
|
class LexicalEntryTraitTest extends TestCase
|
|
{
|
|
public function testThatParseEntryReturnsCorrectlyFormattedVariables()
|
|
{
|
|
$testEntry = <<<DOC
|
|
# ἀγανακτέω/aganakteō
|
|
|
|
This word describes a situation or how something is. It is a verb. However, it is not an action.
|
|
|
|
* This word means to be indignant. That is, a person is angry. When someone is indignant, it is because another person did something wrong to them or insulted them.
|
|
|
|
**Advice to translators**: This type of verb describes a state of being.
|
|
DOC;
|
|
|
|
$testLemma = "ἀγανακτέω/aganakteō";
|
|
$testCommentary = <<<DOC
|
|
This word describes a situation or how something is. It is a verb. However, it is not an action.
|
|
|
|
* This word means to be indignant. That is, a person is angry. When someone is indignant, it is because another person did something wrong to them or insulted them.
|
|
|
|
**Advice to translators**: This type of verb describes a state of being.
|
|
DOC;
|
|
|
|
$handler = new TestHandler();
|
|
list($lemma, $commentary) = $handler->parseEntry($testEntry);
|
|
|
|
$this->assertEquals($testLemma, $lemma);
|
|
$this->assertEquals($testCommentary, $commentary);
|
|
}
|
|
}
|
|
|
|
class TestHandler
|
|
{
|
|
use LexiconEntryTrait;
|
|
}
|