schranz-templating / templating

A template abstraction prototype for php template engines.
MIT License
23 stars 0 forks source link

Functional test Integration #64

Open alexander-schranz opened 1 year ago

alexander-schranz commented 1 year ago

There should be atleast one Functional test for every Template engine in every Framework. As we should go with using the Framework specific tools like roadrunner for Spiral or artisan serve for Laravel a common test would look like this:

class LaravelTwigTest extends AbstractTestCase {
    public static function setUpBeforeClass(): void
    {
         static::serverRun('artisan serve');
    }

    public function testTwig(): void
    {
        $response = $client->request('GET', 'http://127.0.0.1:8000/twig');
        $this->assertHttpStatusCode(200);

        $content = $response->getContent();

        $this->assertStringContainsString('TwigRenderer', $content);
    }
}