-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'SenseException-coverage'
- Loading branch information
Showing
11 changed files
with
395 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Disco package. | ||
* | ||
* (c) bitExpert AG | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace bitExpert\Disco; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
|
||
/** | ||
* Unit tests for {@link \bitExpert\Disco\BeanFactoryAwareTrait}. | ||
*/ | ||
class BeanFactoryAwareTraitUnitTest extends TestCase | ||
{ | ||
/** | ||
* @test | ||
*/ | ||
public function setBeanFactory() | ||
{ | ||
$beanFactory = $this->createMock(BeanFactory::class); | ||
$trait = $this->getMockForTrait(BeanFactoryAwareTrait::class); | ||
|
||
$trait->setBeanFactory($beanFactory); | ||
|
||
self::assertAttributeInstanceOf(BeanFactory::class, 'beanFactory', $trait); | ||
self::assertAttributeSame($beanFactory, 'beanFactory', $trait); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
tests/bitExpert/Disco/Proxy/LazyBean/LazyBeanGeneratorUnitTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Disco package. | ||
* | ||
* (c) bitExpert AG | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace bitExpert\Disco\Proxy\LazyBean; | ||
|
||
use Iterator; | ||
use ProxyManager\Proxy\VirtualProxyInterface; | ||
use ReflectionClass; | ||
use PHPUnit\Framework\TestCase; | ||
use Zend\Code\Generator\ClassGenerator; | ||
|
||
/** | ||
* Unit tests for {@link \bitExpert\Disco\Proxy\LazyBean\LazyBeanGenerator}. | ||
*/ | ||
class LazyBeanGeneratorUnitTest extends TestCase | ||
{ | ||
/** | ||
* @test | ||
*/ | ||
public function generateWithInterfaceAsOriginalObject() | ||
{ | ||
$classGenerator = $this->createMock(ClassGenerator::class); | ||
$classGenerator->expects(self::once()) | ||
->method('setImplementedInterfaces') | ||
->with(array(VirtualProxyInterface::class, Iterator::class)); | ||
|
||
$reflectionClass = new ReflectionClass(Iterator::class); | ||
self::assertTrue($reflectionClass->isInterface()); | ||
|
||
$proxyGenerator = new LazyBeanGenerator(); | ||
$proxyGenerator->generate($reflectionClass, $classGenerator); | ||
} | ||
} |