Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Commit

Permalink
fixes white-space policy
Browse files Browse the repository at this point in the history
  • Loading branch information
alrik committed Aug 30, 2012
1 parent e0a5728 commit ea65e9f
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 47 deletions.
19 changes: 7 additions & 12 deletions test/Definition/ArrayDefinitionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

class ArrayDefinitionTest extends TestCase
{

/**
* @var ArrayDefinition
*/
Expand All @@ -38,14 +37,14 @@ public function testArrayDefinitionHasClasses()

public function testArrayDefinitionHasMethods()
{
$this->assertTrue($this->definition->hasMethods('My\Mapper'));
$this->assertFalse($this->definition->hasMethods('My\EntityA'));
$this->assertTrue($this->definition->hasMethods('My\Mapper'));
$this->assertFalse($this->definition->hasMethods('My\RepositoryA'));
$this->assertFalse($this->definition->hasMethods('My\RepositoryB'));
$this->assertFalse($this->definition->hasMethods('My\Foo'));
$this->assertTrue($this->definition->hasMethods('My\Mapper'));
$this->assertFalse($this->definition->hasMethods('My\EntityA'));
$this->assertTrue($this->definition->hasMethods('My\Mapper'));
$this->assertFalse($this->definition->hasMethods('My\RepositoryA'));
$this->assertFalse($this->definition->hasMethods('My\RepositoryB'));
$this->assertFalse($this->definition->hasMethods('My\Foo'));
}

public function testArrayDefinitionCanGetClassses()
{
$list = array(
Expand All @@ -70,7 +69,6 @@ public function testArrayDefinitionCanGetClassSupertypes()
$this->assertContains('My\RepositoryA', $this->definition->getClassSupertypes('My\RepositoryB'));
}


public function testArrayDefinitionCanGetInstantiator()
{
$this->assertEquals('__construct', $this->definition->getInstantiator('My\RepositoryA'));
Expand All @@ -96,7 +94,4 @@ public function testArrayDefinitionGetInjectionMethodParameters()
{
$this->markTestIncomplete();
}



}
34 changes: 16 additions & 18 deletions test/Definition/BuilderDefinitionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

class BuilderDefinitionTest extends TestCase
{

public function testBuilderImplementsDefinition()
{
$builder = new BuilderDefinition();
Expand Down Expand Up @@ -53,27 +52,26 @@ public function testBuilderCanBuildClassWithMethods()

public function testBuilderDefinitionHasMethodsThrowsRuntimeException()
{
$definition = new BuilderDefinition();
$this->setExpectedException('Zend\Di\Exception\RuntimeException');
$definition->hasMethods('Foo');
$definition = new BuilderDefinition();

$this->setExpectedException('Zend\Di\Exception\RuntimeException');
$definition->hasMethods('Foo');
}

public function testBuilderDefinitionHasMethods()
{
$class = new Builder\PhpClass();
$class->setName('Foo');

$definition = new BuilderDefinition();
$definition->addClass($class);

$this->assertFalse($definition->hasMethods('Foo'));

$class->createInjectionMethod('injectBar');

$this->assertTrue($definition->hasMethods('Foo'));
$class = new Builder\PhpClass();
$class->setName('Foo');

$definition = new BuilderDefinition();
$definition->addClass($class);

$this->assertFalse($definition->hasMethods('Foo'));
$class->createInjectionMethod('injectBar');

$this->assertTrue($definition->hasMethods('Foo'));
}

public function testBuilderCanBuildFromArray()
{
$ini = ConfigFactory::fromFile(__DIR__ . '/../_files/sample.ini');
Expand Down
30 changes: 13 additions & 17 deletions test/Definition/ClassDefinitionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,17 @@

class ClassDefinitionTest extends TestCase
{
public function testClassImplementsDefinition()
{
$definition = new ClassDefinition('Foo');
$this->assertInstanceOf('Zend\Di\Definition\DefinitionInterface', $definition);
}

public function testClassDefinitionHasMethods()
{
$definition = new ClassDefinition('Foo');

$this->assertFalse($definition->hasMethods('Foo'));

$definition->addMethod('doBar');

$this->assertTrue($definition->hasMethods('Foo'));
}
}
public function testClassImplementsDefinition()
{
$definition = new ClassDefinition('Foo');
$this->assertInstanceOf('Zend\Di\Definition\DefinitionInterface', $definition);
}

public function testClassDefinitionHasMethods()
{
$definition = new ClassDefinition('Foo');
$this->assertFalse($definition->hasMethods('Foo'));
$definition->addMethod('doBar');
$this->assertTrue($definition->hasMethods('Foo'));
}
}

0 comments on commit ea65e9f

Please sign in to comment.