A collection of test helpers for Symfony 2 projects
PHP HTML
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
build
src/InterNations/Component/Testing
tests/InterNations/Component/Testing/Tests
.gitignore
.travis.yml
README.md
build.xml
composer.json
phpunit.xml.dist

README.md

Test helpers for Symfony projects

Gitter Build Status Dependency Status Average time to resolve an issue Percentage of issues still open

A collection of test helpers to ease testing of Symfony3 projects.

The base test class

<?php
use InterNations\Component\Testing\AbstractTestCase;

class MyTest extends AbstractTestCase
{
    private $sut;

    public function setUp()
    {
        $this->sut = $this->getSimpleMock('MyComponent');
    }
}

Accessing restricted members

<?php
use InterNations\Component\Testing\AccessTrait;


class MyTest ...
{
    use AccessTrait;

    public function testSomething()
    {
        $this->setNonPublicProperty($this->sut, 'privateProperty', 'value');
        $this->callNonPublicMethod($this->sut, 'protectedMethod', ['arg1', 'arg2']);
    }
}