Skip to content

Commit

Permalink
Tests: test also passing references
Browse files Browse the repository at this point in the history
  • Loading branch information
f3l1x committed Aug 7, 2020
1 parent 2626b7c commit 9c02f6f
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/cases/DI/Configuration/EntityListenerResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,19 @@ public function testStatement(): void
$this->assertInstanceOf(DefaultEntityListenerResolver::class, $configuration->getEntityListenerResolver());
}

public function testReference(): void
{
$configuration = $this->createConfiguration(function (Compiler $compiler): void {
$compiler->addConfig(NeonLoader::load('
services:
reference: Doctrine\ORM\Mapping\DefaultEntityListenerResolver()
nettrine.orm:
configuration:
entityListenerResolver: @reference
'));
});
$this->assertInstanceOf(DefaultEntityListenerResolver::class, $configuration->getEntityListenerResolver());
}

}
15 changes: 15 additions & 0 deletions tests/cases/DI/Configuration/NamingStrategyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,19 @@ public function testStatement(): void
$this->assertInstanceOf(UnderscoreNamingStrategy::class, $configuration->getNamingStrategy());
}

public function testReference(): void
{
$configuration = $this->createConfiguration(function (Compiler $compiler): void {
$compiler->addConfig(NeonLoader::load('
services:
reference: Doctrine\ORM\Mapping\UnderscoreNamingStrategy()
nettrine.orm:
configuration:
namingStrategy: @reference
'));
});
$this->assertInstanceOf(UnderscoreNamingStrategy::class, $configuration->getNamingStrategy());
}

}
15 changes: 15 additions & 0 deletions tests/cases/DI/Configuration/QuoteStrategyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,19 @@ public function testStatement(): void
$this->assertInstanceOf(AnsiQuoteStrategy::class, $configuration->getQuoteStrategy());
}

public function testReference(): void
{
$configuration = $this->createConfiguration(function (Compiler $compiler): void {
$compiler->addConfig(NeonLoader::load('
services:
reference: Doctrine\ORM\Mapping\AnsiQuoteStrategy()
nettrine.orm:
configuration:
quoteStrategy: @reference
'));
});
$this->assertInstanceOf(AnsiQuoteStrategy::class, $configuration->getQuoteStrategy());
}

}
15 changes: 15 additions & 0 deletions tests/cases/DI/Configuration/RepositoryFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,19 @@ public function testStatement(): void
$this->assertInstanceOf(DefaultRepositoryFactory::class, $configuration->getRepositoryFactory());
}

public function testReference(): void
{
$configuration = $this->createConfiguration(function (Compiler $compiler): void {
$compiler->addConfig(NeonLoader::load('
services:
reference: Doctrine\ORM\Repository\DefaultRepositoryFactory()
nettrine.orm:
configuration:
repositoryFactory: @reference
'));
});
$this->assertInstanceOf(DefaultRepositoryFactory::class, $configuration->getRepositoryFactory());
}

}

0 comments on commit 9c02f6f

Please sign in to comment.