en_btr_backend/tests/Unit/LexicalEntryTest.php

23 lines
596 B
PHP

<?php
namespace Tests\Unit;
use App\LexicalEntry;
use App\Word;
use Tests\TestCase;
class LexicalEntryTest extends TestCase
{
public function testWordLexicalEntryRelationship()
{
$lexicalEntry = LexicalEntry::where('id', 'G2041')->with('words')->first();
$this->assertNotEmpty($lexicalEntry, 'Must be able to find a valid LexicalEntry');
$lWord = $lexicalEntry->words[0];
$word = Word::find($lWord->id);
$this->assertNotEmpty($word, 'Must be able to find a matching Word');
$this->assertEquals($lexicalEntry->words[0], $word);
}}