Skip to content

Extract message factory #30

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

Merged
merged 2 commits into from
Dec 17, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ cache:
- $HOME/.composer/cache

php:
- 5.4
- 5.5
- 5.6
- 7.0
Expand All @@ -24,7 +23,7 @@ branches:
matrix:
fast_finish: true
include:
- php: 5.4
- php: 5.5
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" COVERAGE=true TEST_COMMAND="composer test-ci"

before_install:
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@
"php-http/message-factory": "^1.0"
},
"require-dev": {
"php-http/utils": "^0.2",
"zendframework/zend-diactoros": "^1.0",
"guzzlehttp/psr7": "^1.0",
"php-http/guzzle6-adapter": "^0.2",
"phpspec/phpspec": "^2.4",
"henrikbjorn/phpspec-code-coverage" : "^1.0"
},
"suggest": {
"zendframework/zend-diactoros": "Used with Diactoros Factories",
"guzzlehttp/psr7": "Used with Guzzle PSR-7 Factories"
"php-http/utils": "To use Guzzle or Diactoros factories"
},
"autoload": {
"psr-4": {
Expand Down
22 changes: 22 additions & 0 deletions spec/ClassDiscoverySpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,28 @@ function it_registers_a_class_with_a_boolean_condition()
$this->find()->shouldHaveType('spec\Http\Discovery\AnotherClassToFind');
}

function it_registers_a_class_with_an_array_condition()
{
$this->reset();

$this->register(
'spec\Http\Discovery\AnotherClassToFind',
[
true,
'spec\Http\Discovery\AnotherClassToFind',
]
);
$this->register(
'spec\Http\Discovery\ClassToFind',
[
false,
'spec\Http\Discovery\ClassToFind',
]
);

$this->find()->shouldHaveType('spec\Http\Discovery\AnotherClassToFind');
}

function it_registers_a_class_with_an_invalid_condition()
{
$this->reset();
Expand Down
47 changes: 0 additions & 47 deletions spec/MessageFactory/DiactorosMessageFactorySpec.php

This file was deleted.

29 changes: 0 additions & 29 deletions spec/MessageFactory/GuzzleMessageFactorySpec.php

This file was deleted.

5 changes: 5 additions & 0 deletions spec/MessageFactoryDiscoverySpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ function it_is_a_class_discovery()
$this->shouldHaveType('Http\Discovery\ClassDiscovery');
}

function it_is_a_factory_discovery()
{
$this->shouldHaveType('Http\Discovery\FactoryDiscovery');
}

function it_finds_an_http_message_factory()
{
$this->find()->shouldHaveType('Http\Message\MessageFactory');
Expand Down
49 changes: 0 additions & 49 deletions spec/StreamFactory/DiactorosStreamFactorySpec.php

This file was deleted.

49 changes: 0 additions & 49 deletions spec/StreamFactory/GuzzleStreamFactorySpec.php

This file was deleted.

5 changes: 5 additions & 0 deletions spec/StreamFactoryDiscoverySpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ function it_is_a_class_discovery()
$this->shouldHaveType('Http\Discovery\ClassDiscovery');
}

function it_is_a_factory_discovery()
{
$this->shouldHaveType('Http\Discovery\FactoryDiscovery');
}

function it_finds_an_http_stream_factory()
{
$this->find()->shouldHaveType('Http\Message\StreamFactory');
Expand Down
42 changes: 0 additions & 42 deletions spec/UriFactory/DiactorosUriFactorySpec.php

This file was deleted.

34 changes: 0 additions & 34 deletions spec/UriFactory/GuzzleUriFactorySpec.php

This file was deleted.

5 changes: 5 additions & 0 deletions spec/UriFactoryDiscoverySpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ function it_is_a_class_discovery()
$this->shouldHaveType('Http\Discovery\ClassDiscovery');
}

function it_is_a_factory_discovery()
{
$this->shouldHaveType('Http\Discovery\FactoryDiscovery');
}

function it_finds_an_http_uri_factory()
{
$this->find()->shouldHaveType('Http\Message\UriFactory');
Expand Down
Loading