Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Feature/Documents/ReceiptTest.php
Show First 20 Lines • Show All 79 Lines • ▼ Show 20 Lines | public function testHtmlOutput(): void | ||||
// Customer data | // Customer data | ||||
$customer = $dom->getElementById('customer'); | $customer = $dom->getElementById('customer'); | ||||
$customerCells = $customer->getElementsByTagName('td'); | $customerCells = $customer->getElementsByTagName('td'); | ||||
$customerOutput = $this->getNodeContent($customerCells[0]); | $customerOutput = $this->getNodeContent($customerCells[0]); | ||||
$customerExpected = "Firstname Lastname\nTest Unicode Straße 150\n10115 Berlin"; | $customerExpected = "Firstname Lastname\nTest Unicode Straße 150\n10115 Berlin"; | ||||
$this->assertSame($customerExpected, $this->getNodeContent($customerCells[0])); | $this->assertSame($customerExpected, $this->getNodeContent($customerCells[0])); | ||||
$customerIdents = $this->getNodeContent($customerCells[1]); | $customerIdents = $this->getNodeContent($customerCells[1]); | ||||
$this->assertTrue(strpos($customerIdents, "Account ID {$wallet->id}") !== false); | //$this->assertTrue(strpos($customerIdents, "Account ID {$wallet->id}") !== false); | ||||
$this->assertTrue(strpos($customerIdents, "Customer No. {$wallet->owner->id}") !== false); | $this->assertTrue(strpos($customerIdents, "Customer No. {$wallet->owner->id}") !== false); | ||||
// Company details in the footer | // Company details in the footer | ||||
$footer = $dom->getElementById('footer'); | $footer = $dom->getElementById('footer'); | ||||
$footerOutput = $footer->textContent; | $footerOutput = $footer->textContent; | ||||
$this->assertStringStartsWith(\config('app.company.details'), $footerOutput); | $this->assertStringStartsWith(\config('app.company.details'), $footerOutput); | ||||
$this->assertTrue(strpos($footerOutput, \config('app.company.email')) !== false); | $this->assertTrue(strpos($footerOutput, \config('app.company.email')) !== false); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 216 Lines • Show Last 20 Lines |