mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-20 16:00:56 -04:00
Make PdfMakerTest green
This commit is contained in:
parent
60a73fada3
commit
a9debacce2
10106
coverage.xml
Normal file
10106
coverage.xml
Normal file
File diff suppressed because it is too large
Load Diff
13
tests/Feature/PdfMaker/ExampleDesign.php
Normal file
13
tests/Feature/PdfMaker/ExampleDesign.php
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tests\Feature\PdfMaker;
|
||||||
|
|
||||||
|
class ExampleDesign
|
||||||
|
{
|
||||||
|
public function html()
|
||||||
|
{
|
||||||
|
return file_get_contents(
|
||||||
|
base_path('tests/Feature/PdfMaker/example-design.html')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -127,7 +127,7 @@ class PdfMakerDesignsTest extends TestCase
|
|||||||
$maker = new PdfMaker($state);
|
$maker = new PdfMaker($state);
|
||||||
|
|
||||||
$maker
|
$maker
|
||||||
->design(Business::class)
|
->design(ExampleDesign::class)
|
||||||
->build();
|
->build();
|
||||||
|
|
||||||
exec('echo "" > storage/logs/laravel.log');
|
exec('echo "" > storage/logs/laravel.log');
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace Tests\Feature\PdfMaker;
|
namespace Tests\Feature\PdfMaker;
|
||||||
|
|
||||||
|
use App\Services\PdfMaker\PdfMaker;
|
||||||
use Spatie\Browsershot\Browsershot;
|
use Spatie\Browsershot\Browsershot;
|
||||||
use Tests\TestCase;
|
use Tests\TestCase;
|
||||||
|
|
||||||
@ -12,18 +13,13 @@ class PdfMakerTest extends TestCase
|
|||||||
'variables' => [],
|
'variables' => [],
|
||||||
];
|
];
|
||||||
|
|
||||||
public function setUp() :void
|
|
||||||
{
|
|
||||||
$this->markTestSkipped();
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testDesignLoadsCorrectly()
|
public function testDesignLoadsCorrectly()
|
||||||
{
|
{
|
||||||
$maker = new PdfMaker($this->state);
|
$maker = new PdfMaker($this->state);
|
||||||
|
|
||||||
$maker->design(Business::class);
|
$maker->design(ExampleDesign::class);
|
||||||
|
|
||||||
$this->assertInstanceOf(Business::class, $maker->design);
|
$this->assertInstanceOf(ExampleDesign::class, $maker->design);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testHtmlDesignLoadsCorrectly()
|
public function testHtmlDesignLoadsCorrectly()
|
||||||
@ -31,7 +27,7 @@ class PdfMakerTest extends TestCase
|
|||||||
$maker = new PdfMaker($this->state);
|
$maker = new PdfMaker($this->state);
|
||||||
|
|
||||||
$maker
|
$maker
|
||||||
->design(Business::class)
|
->design(ExampleDesign::class)
|
||||||
->build();
|
->build();
|
||||||
|
|
||||||
$this->assertStringContainsString('<!-- Business -->', $maker->getCompiledHTML());
|
$this->assertStringContainsString('<!-- Business -->', $maker->getCompiledHTML());
|
||||||
@ -42,7 +38,7 @@ class PdfMakerTest extends TestCase
|
|||||||
$maker = new PdfMaker($this->state);
|
$maker = new PdfMaker($this->state);
|
||||||
|
|
||||||
$maker
|
$maker
|
||||||
->design(Business::class)
|
->design(ExampleDesign::class)
|
||||||
->build();
|
->build();
|
||||||
|
|
||||||
$this->assertEquals('table', $maker->getSectionNode('product-table')->nodeName);
|
$this->assertEquals('table', $maker->getSectionNode('product-table')->nodeName);
|
||||||
@ -73,7 +69,7 @@ class PdfMakerTest extends TestCase
|
|||||||
$maker = new PdfMaker($state);
|
$maker = new PdfMaker($state);
|
||||||
|
|
||||||
$maker
|
$maker
|
||||||
->design(Business::class)
|
->design(ExampleDesign::class)
|
||||||
->build();
|
->build();
|
||||||
|
|
||||||
$this->assertStringContainsString('my-awesome-class', $maker->getSection('product-table', 'class'));
|
$this->assertStringContainsString('my-awesome-class', $maker->getSection('product-table', 'class'));
|
||||||
@ -108,7 +104,7 @@ class PdfMakerTest extends TestCase
|
|||||||
$maker = new PdfMaker($state);
|
$maker = new PdfMaker($state);
|
||||||
|
|
||||||
$maker
|
$maker
|
||||||
->design(Business::class)
|
->design(ExampleDesign::class)
|
||||||
->build();
|
->build();
|
||||||
|
|
||||||
$this->assertStringContainsString('Invoice Ninja', $maker->getCompiledHTML());
|
$this->assertStringContainsString('Invoice Ninja', $maker->getCompiledHTML());
|
||||||
@ -152,7 +148,7 @@ class PdfMakerTest extends TestCase
|
|||||||
$maker = new PdfMaker($state);
|
$maker = new PdfMaker($state);
|
||||||
|
|
||||||
$maker
|
$maker
|
||||||
->design(Business::class)
|
->design(ExampleDesign::class)
|
||||||
->build();
|
->build();
|
||||||
|
|
||||||
$compiled = 'contact@invoiceninja.com';
|
$compiled = 'contact@invoiceninja.com';
|
||||||
@ -172,7 +168,7 @@ class PdfMakerTest extends TestCase
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
$maker1
|
$maker1
|
||||||
->design(Business::class)
|
->design(ExampleDesign::class)
|
||||||
->build();
|
->build();
|
||||||
|
|
||||||
$output1 = $maker1->getCompiledHTML();
|
$output1 = $maker1->getCompiledHTML();
|
||||||
@ -189,7 +185,7 @@ class PdfMakerTest extends TestCase
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
$maker2
|
$maker2
|
||||||
->design(Business::class)
|
->design(ExampleDesign::class)
|
||||||
->build();
|
->build();
|
||||||
|
|
||||||
$output2 = $maker2->getCompiledHTML();
|
$output2 = $maker2->getCompiledHTML();
|
||||||
@ -215,7 +211,7 @@ class PdfMakerTest extends TestCase
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
$maker
|
$maker
|
||||||
->design(Business::class)
|
->design(ExampleDesign::class)
|
||||||
->build();
|
->build();
|
||||||
|
|
||||||
$node = $maker->getSectionNode('header');
|
$node = $maker->getSectionNode('header');
|
||||||
@ -242,7 +238,7 @@ class PdfMakerTest extends TestCase
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
$maker
|
$maker
|
||||||
->design(Business::class)
|
->design(ExampleDesign::class)
|
||||||
->build();
|
->build();
|
||||||
|
|
||||||
$node = $maker->getSectionNode('header');
|
$node = $maker->getSectionNode('header');
|
||||||
@ -306,11 +302,9 @@ class PdfMakerTest extends TestCase
|
|||||||
$maker = new PdfMaker($state);
|
$maker = new PdfMaker($state);
|
||||||
|
|
||||||
$maker
|
$maker
|
||||||
->design(Business::class)
|
->design(ExampleDesign::class)
|
||||||
->build();
|
->build();
|
||||||
|
|
||||||
info($maker->getCompiledHTML());
|
|
||||||
|
|
||||||
$this->assertTrue(true);
|
$this->assertTrue(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user