Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[READ ONLY] Ovos Mod #14

Open
wants to merge 45 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
f20fd0b
Use sourceCache if isSupported check passes, otherwise proceed withou…
falkenhawk Apr 25, 2019
f0a109b
DefinitionGlob to specify a pattern for definition files
falkenhawk Apr 25, 2019
d494750
Prefer composition over inheritance
falkenhawk Apr 26, 2019
ddf0cbd
Optimize compiled string definitions
falkenhawk Apr 27, 2019
4f3fc0d
Optimize compiled factory definitions
falkenhawk Apr 28, 2019
59a2216
AnnotationBasedAutowiring with additional options for performance tweaks
falkenhawk Apr 26, 2019
1cce07a
ServiceLocator
falkenhawk Apr 29, 2019
99305d2
Discard ServiceLocatorRepository::injectOn() method
falkenhawk Apr 30, 2019
7a71a1f
ServiceLocator - rename entry to subscriber, cleanup
falkenhawk May 30, 2019
3938947
ServiceLocatorRepository - replace setService with override method
falkenhawk May 30, 2019
1aa1834
Reference and ServiceLocatorDefinition cleanup
falkenhawk May 30, 2019
d8ea15e
compiler - extract resolveServiceLocator method to CompiledContainer
falkenhawk May 30, 2019
0d1265d
tests for service locators
falkenhawk May 30, 2019
2a10132
code formatting
falkenhawk May 30, 2019
ffad7c9
Merge pull request #2 from ovos/feature/definition-glob
falkenhawk May 30, 2019
851c7c5
Merge pull request #3 from ovos/feature/loosen-apcu-check
falkenhawk May 30, 2019
82af93e
Merge pull request #5 from ovos/feature/compiler-optimize-string-defi…
falkenhawk May 30, 2019
d314100
Merge pull request #6 from ovos/feature/compiler-optimize-factories
falkenhawk May 30, 2019
f2709cd
Merge pull request #4 from ovos/feature/annotations-autowiring-options
falkenhawk May 30, 2019
0fe5cce
Merge pull request #7 from ovos/feature/service-locator
falkenhawk May 30, 2019
4aee110
Merge pull request #7 from ovos/feature/service-locator
falkenhawk May 30, 2019
3fef38a
change package name in composer.json
falkenhawk May 30, 2019
661e59b
Merge branch 'master' into mod
falkenhawk Nov 29, 2019
2466176
Merge pull request #11 from ovos/feature/sourcecache-namespaced
falkenhawk Dec 12, 2019
d7d99f6
Merge pull request #12 from ovos/feature/travis-enable-apcu
falkenhawk Dec 12, 2019
c1a4f7d
Merge branch 'refs/heads/master' into mod
falkenhawk Dec 12, 2019
aa38cca
Merge remote-tracking branch 'ovos/master' into feature/definition-glob
partikus Jan 20, 2021
7b4540a
fix: bump phpunit assertions
partikus Jan 20, 2021
720036d
Merge remote-tracking branch 'ovos/master' into feature/compiler-opti…
partikus Jan 20, 2021
d113eb7
Merge remote-tracking branch 'ovos/master' into feature/compiler-opti…
partikus Jan 20, 2021
4a570b7
adding leading backslash to all native constants
partikus Jan 20, 2021
87b53f1
add psr container exception to the ignored errors
partikus Jan 21, 2021
d474395
csfix
partikus Jan 21, 2021
5219321
Merge branch 'master' into feature/annotations-autowiring-options-wsl
partikus Jan 21, 2021
239a39f
get rid of using deprecated expectException annotations
partikus Jan 21, 2021
80d5ae3
fix a missing default type for Reference::
partikus Jan 21, 2021
33059cf
csfix
partikus Jan 21, 2021
3ab1aab
Merge branch 'feature/annotations-autowiring-options-wsl' into mod
partikus Jan 21, 2021
08bd184
Merge branch 'feature/compiler-optimize-factories' into mod
partikus Jan 21, 2021
25fae83
Merge branch 'feature/compiler-optimize-string-definitions' into mod
partikus Jan 21, 2021
395001c
Merge branch 'feature/definition-glob' into mod
partikus Jan 21, 2021
c119aec
Merge branch 'feature/csfix' into mod
partikus Jan 21, 2021
ce95893
Merge branch 'feature/phpstan-ignore-psr-container-exception' into mod
partikus Jan 21, 2021
2f44a4c
csfix
partikus Jan 21, 2021
a255d11
Merge branch 'feature/annotations-autowiring-options-wsl' into mod
partikus Jan 21, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
get rid of using deprecated expectException annotations
  • Loading branch information
partikus committed Jan 21, 2021
commit 239a39fccccfbda0a627c50a08803c25896eb80c
10 changes: 6 additions & 4 deletions tests/IntegrationTest/ServiceLocatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,12 @@ public function testServiceLocator(ContainerBuilder $builder)

/**
* @dataProvider provideContainer
* @expectedException \DI\NotFoundException
* @expectedExceptionMessage Service 'baz' is not defined.
*/
public function testServiceLocatorThrowsForInvalidService(ContainerBuilder $builder)
{
$this->expectException(\DI\NotFoundException::class);
$this->expectExceptionMessage('Service \'baz\' is not defined.');

$builder->addDefinitions([
'baz' => 'baz',
]);
Expand Down Expand Up @@ -99,11 +100,12 @@ public function testOverrideServiceInRepositoryDefinition(ContainerBuilder $buil

/**
* @dataProvider provideContainer
* @expectedException \LogicException
* @expectedExceptionMessage Service 'foo' for 'DI\Test\IntegrationTest\ServiceLocatorTest\ServiceSubscriber' cannot be overridden - ServiceLocator is already created.
*/
public function testCannotOverrideServiceForAlreadyInstantiatedSubscriber(ContainerBuilder $builder)
{
$this->expectException(\LogicException::class);
$this->expectExceptionMessage('Service \'foo\' for \'DI\Test\IntegrationTest\ServiceLocatorTest\ServiceSubscriber\' cannot be overridden - ServiceLocator is already created.');

$container = $builder->build();

$container->get(ServiceLocatorTest\ServiceSubscriber::class);
Expand Down
10 changes: 6 additions & 4 deletions tests/UnitTest/Definition/ReferenceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,22 +102,24 @@ public function should_not_be_a_service_locator_entry()

/**
* @test
* @expectedException \DI\Definition\Exception\InvalidDefinition
* @expectedExceptionMessage Invalid service locator definition ('bar' for 'foo')
*/
public function should_throw_on_invalid_service_locator_entry()
{
$this->expectException(\DI\Definition\Exception\InvalidDefinition::class);
$this->expectExceptionMessage('Invalid service locator definition (\'bar\' for \'foo\')');

$definition = new Reference('bar', 'foo');
$definition->getServiceLocatorDefinition();
}

/**
* @test
* @expectedException \DI\Definition\Exception\InvalidDefinition
* @expectedExceptionMessage Invalid service locator definition ('DI\ServiceLocator' for '')
*/
public function should_throw_on_invalid_service_locator_entry2()
{
$this->expectException(\DI\Definition\Exception\InvalidDefinition::class);
$this->expectExceptionMessage('Invalid service locator definition (\'DI\ServiceLocator\' for \'\')');

$definition = new Reference(Reference::$serviceLocatorClass);
$definition->getServiceLocatorDefinition();
}
Expand Down
5 changes: 3 additions & 2 deletions tests/UnitTest/Definition/ServiceLocatorDefinitionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,12 @@ public function should_have_a_name_and_requesting_name()

/**
* @test
* @expectedException \DI\ServiceSubscriberException
* @expectedExceptionMessage The class DI\Test\UnitTest\Fixtures\Singleton does not implement ServiceSubscriberInterface.
*/
public function cannot_resolve_without_proper_subscriber()
{
$this->expectException(\DI\ServiceSubscriberException::class);
$this->expectExceptionMessage('The class DI\Test\UnitTest\Fixtures\Singleton does not implement ServiceSubscriberInterface.');

$container = $this->easyMock(ContainerInterface::class);
$definition = new ServiceLocatorDefinition(ServiceLocator::class, Singleton::class);

Expand Down
14 changes: 6 additions & 8 deletions tests/UnitTest/ServiceLocator/ServiceLocatorRepositoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,11 @@ public function testCreateServiceLocator()
$this->assertEquals($expectedServices, $serviceLocator->getServices());
}

/**
* @expectedException \DI\NotFoundException
* @expectedExceptionMessage Service locator for entry 'something' is not initialized.
*/
public function testServiceLocatorNotCreated()
{
$this->expectException(\DI\NotFoundException::class);
$this->expectExceptionMessage('Service locator for entry \'something\' is not initialized.');

$container = ContainerBuilder::buildDevContainer();
$repository = new ServiceLocatorRepository($container);
$repository->get('something');
Expand Down Expand Up @@ -94,12 +93,11 @@ public function testCanCreateMultipleWithSameServices()
$this->assertSame($locator3, $locator5);
}

/**
* @expectedException \LogicException
* @expectedExceptionMessage ServiceLocator for 'test' cannot be recreated with different services.
*/
public function testCannotCreateMultipleWithDifferentServices()
{
$this->expectException(\LogicException::class);
$this->expectExceptionMessage('ServiceLocator for \'test\' cannot be recreated with different services.');

$container = ContainerBuilder::buildDevContainer();
$repository = new ServiceLocatorRepository($container);

Expand Down
7 changes: 3 additions & 4 deletions tests/UnitTest/ServiceLocator/ServiceLocatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,11 @@ public function testInstantiation()
$this->assertEquals('test', $serviceLocator->getSubscriber());
}

/**
* @expectedException \DI\NotFoundException
* @expectedExceptionMessage Service 'something' is not defined.
*/
public function testServiceNotDefined()
{
$this->expectException(\DI\NotFoundException::class);
$this->expectExceptionMessage('Service \'something\' is not defined.');

$container = ContainerBuilder::buildDevContainer();
$serviceLocator = new ServiceLocator($container, [], 'test');
$serviceLocator->get('something');
Expand Down