Skip to content

Commit

Permalink
Merge pull request #1 from qlimix/v2
Browse files Browse the repository at this point in the history
V2
  • Loading branch information
frank-q committed Apr 19, 2020
2 parents 9884259 + d6c23e3 commit a0f0e80
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 57 deletions.
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
language: php

php:
- 7.2
- 7.3
- 7.4
- nightly

matrix:
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
## 2.0.0 - 19-04-2020

Changes:
- Updated to PHP 7.4
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@
}
],
"require": {
"php": ">=7.2",
"qlimix/dependency-container": "^1.0",
"php": ">=7.4",
"qlimix/dependency-container": "^2.0",
"pimple/pimple": "^3.2"
},
"require-dev": {
"qlimix/code-standard": "^2.0"
},
"autoload": {
"psr-4": {
"Qlimix\\DependencyContainer\\": "src/"
Expand All @@ -32,8 +35,5 @@
},
"config": {
"sort-packages": true
},
"require-dev": {
"qlimix/code-standard": "^1.0"
}
}
3 changes: 1 addition & 2 deletions src/PimpleDependencyRegistry.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@

final class PimpleDependencyRegistry implements RegistryInterface
{
/** @var Container */
private $pimple;
private Container $pimple;

public function __construct(Container $pimple)
{
Expand Down
61 changes: 13 additions & 48 deletions tests/PimpleDependencyRegistryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,17 @@

final class PimpleDependencyRegistryTest extends TestCase
{
/** @var Container */
private $container;
private Container $container;

/** @var PimpleDependencyRegistry */
private $registry;
private PimpleDependencyRegistry $registry;

protected function setUp(): void
{
$this->container = new Container();
$this->registry = new PimpleDependencyRegistry($this->container);
}

/**
* @test
*/
public function shouldSetService(): void
public function testShouldSetService(): void
{
$id = 'id';
$return = new stdClass();
Expand All @@ -36,10 +31,7 @@ public function shouldSetService(): void
$this->assertSame($return, $this->registry->get($id));
}

/**
* @test
*/
public function shouldSetValue(): void
public function testShouldSetValue(): void
{
$id = 'id';
$return = 'value';
Expand All @@ -51,10 +43,7 @@ public function shouldSetValue(): void
$this->assertSame($return, $this->registry->get($id));
}

/**
* @test
*/
public function shouldSetMaker(): void
public function testShouldSetMaker(): void
{
$id = 'id';
$value = 0;
Expand All @@ -66,10 +55,7 @@ public function shouldSetMaker(): void
$this->assertSame($value+1, $this->registry->make($id));
}

/**
* @test
*/
public function shouldMakeMultipleDifferent(): void
public function testShouldMakeMultipleDifferent(): void
{
$id = 'id';
$value = 0;
Expand All @@ -85,10 +71,7 @@ public function shouldMakeMultipleDifferent(): void
$this->assertSame($value+1, $this->registry->make($id));
}

/**
* @test
*/
public function shouldSetOnSetId(): void
public function testShouldSetOnSetId(): void
{
$id = 'id';
$setId = 'foo';
Expand All @@ -104,10 +87,7 @@ public function shouldSetOnSetId(): void
$this->assertSame($make, $makeAnother);
}

/**
* @test
*/
public function shouldMerge(): void
public function testShouldMerge(): void
{
$id = 'id';

Expand All @@ -133,10 +113,7 @@ public function shouldMerge(): void
$this->assertSame('barfoo' ,$values['foobar']);
}

/**
* @test
*/
public function shouldMergeNoneSetId(): void
public function testShouldMergeNoneSetId(): void
{
$id = 'id';

Expand All @@ -155,10 +132,7 @@ public function shouldMergeNoneSetId(): void
$this->assertSame('barfoo' ,$values['foobar']);
}

/**
* @test
*/
public function shouldHaveValueId(): void
public function testShouldHaveValueId(): void
{
$id = 'id';
$value = 1;
Expand All @@ -168,10 +142,7 @@ public function shouldHaveValueId(): void
$this->assertTrue($this->registry->has($id));
}

/**
* @test
*/
public function shouldHaveServiceId(): void
public function testShouldHaveServiceId(): void
{
$id = 'id';
$value = 1;
Expand All @@ -183,20 +154,14 @@ public function shouldHaveServiceId(): void
$this->assertTrue($this->registry->has($id));
}

/**
* @test
*/
public function shouldNotHaveValueId(): void
public function testShouldNotHaveValueId(): void
{
$id = 'id';

$this->assertFalse($this->registry->has($id));
}

/**
* @test
*/
public function shouldNotHaveServiceId(): void
public function testShouldNotHaveServiceId(): void
{
$id = 'id';

Expand Down

0 comments on commit a0f0e80

Please sign in to comment.