Closed rmsint closed 11 years ago
@dantleech with the current version of the testing component I get underneath error, do you know perhaps how to solve this? Also the test app does not have the server:run
command registered, do you see maybe what is done wrong?
PHP Fatal error: Class 'Doctrine\ORM\Version' not found in xx/cmf-sandbox/vendor/symfony-cmf/media-bundle/Symfony/Cmf/Bundle/MediaBundle/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/DependencyInjection/DoctrineExtension.php on line 298
Hmm, that's probably caused by the latest merge which introduced ORM support, best to find out what is trying to instantiate that Version class and fix it. (I am away from computer ATM).
For server:run you need PHP5.4 otherwise you can serve the web directory in treating component in Apache.
@dantleech Thanks, got it working. Checked out an older version of the testing component and used PHP5.4.
Found some fixes to be done during writing an application file test:
@dantleech, @sjopet are you ok to merge this? Then we can add tests in other PRs separately, I think we will move faster then.
Looks good @rmsint , one thing that would be neat is if we could add a simple web test to test the file page of the test application:
// something like Tests/WebTest/TestApp/FileTest.php
public function testPage()
{
$client = $this->createClient();
$client->get('/file'); // or $this->getContainer()->get('route')->generate('route_name')
$resp = $client->getResponse();
$this->assertEquals(200, $resp->getStatusCode());
}
This is a really basic, but extremely useful way of testing for regressions (providing != 200 means an error :)
Thanks @dantleech, added also the WebTest case. Works really nice the testing component! I'd like to add more application test pages and WebTestCases to test and demo the different features.
Tests are not included and can be added in this PR or later separately.