2017 © Pedro Peláez
 

library SfCcTesting

A port of the Symfony2 testing mechanism to symfony 1.X.

image

odino/SfCcTesting

A port of the Symfony2 testing mechanism to symfony 1.X.

  • Wednesday, February 1, 2012
  • by odino
  • Repository
  • 2 Watchers
  • 2 Stars
  • 1,148 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

SfCcTesting: Symfony 1.X Client-Crawler Testing

A small library that brings the Symfony2 functional testing mechanism into symfony 1.X., (*1)

Installation

Clone the repository under the lib/vendor/odino directory: you can change the location of the library, although this is the recommended one., (*2)

``` bash git clone git@github.com:odino/SfCcTesting.git lib/vendor/odino/SfCcTesting, (*3)


Move into the library's root, download composer and install the dependencies: ``` bash cd lib/vendor/odino/SfCcTesting wget http://getcomposer.org/composer.phar php composer.phar install

Make a symbolic link from the root of your application to the default phpunit.xml.dist configuration file:, (*4)

``` bash ln -s lib/vendor/odino/SfCcTesting/phpunit.xml.dist phpunit.xml, (*5)


(this is just a hint, you can use your specific configuration file) Write your first test: ``` bash touch test/phpunit/HomepageTest.php

``` php <?php, (*6)

use Symfony\Component\DomCrawler\Crawler; use odino\SfCcTesting\WebTestCase;, (*7)

class HomepageTest extends WebTestCase {
public function testHelloWorld() {
$client = $this->createClient(); $crawler = $client->get('/');, (*8)

$this->assertEquals("Hello world", $crawler->filter('h1')->text());

}, (*9)

protected function getApplication() { return 'frontend'; }, (*10)

protected function bootstrapSymfony($app) { include(dirname(FILE).'/../../test/bootstrap/functional.php'); } } ```, (*11)

and run it with a simple phpunit test/phpunit from the root of your symfony 1.X project., (*12)

testing output#, (*13)

The Versions

01/02 2012

dev-master

9999999-dev

A port of the Symfony2 testing mechanism to symfony 1.X.

  Sources   Download

MIT

The Requires

 

test phpunit symfony