Skip to content
This repository has been archived by the owner on Dec 31, 2022. It is now read-only.

Commit

Permalink
Merge pull request #8 from sunrise-php/release/v1.1.0
Browse files Browse the repository at this point in the history
v1.1.0
  • Loading branch information
fenric committed Dec 26, 2020
2 parents 8698484 + d30bcdb commit 39c20a7
Show file tree
Hide file tree
Showing 9 changed files with 90 additions and 56 deletions.
3 changes: 0 additions & 3 deletions .editorconfig
Expand Up @@ -14,8 +14,5 @@ insert_final_newline = true
[*.md]
trim_trailing_whitespace = false

[*.php]
indent_style = tab

[*.yml]
indent_size = 2
4 changes: 4 additions & 0 deletions .gitignore
@@ -1,3 +1,7 @@
.php_cs.cache
.phpunit.result.cache
composer.lock
coverage.xml
phpcs.xml
phpunit.xml
vendor/
4 changes: 3 additions & 1 deletion .travis.yml
Expand Up @@ -5,6 +5,8 @@ matrix:
- php: 7.1
- php: 7.2
- php: 7.3
- php: 7.4
- php: nightly
fast_finish: true

before_install:
Expand All @@ -13,4 +15,4 @@ before_install:
install:
- travis_retry composer install --no-interaction --prefer-source --no-suggest

script: vendor/bin/phpunit --colors=always --coverage-text
script: php vendor/bin/phpunit --colors=always --coverage-text
2 changes: 1 addition & 1 deletion LICENSE
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2018 Anatoly Fenric
Copyright (c) 2018 Sunrise // PHP

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
10 changes: 3 additions & 7 deletions README.md
@@ -1,7 +1,7 @@
## HTTP factory for PHP 7.1+ based on PSR-17
## HTTP factory for PHP 7.1+ (incl. PHP 8) based on PSR-17

[![Gitter](https://badges.gitter.im/sunrise-php/support.png)](https://gitter.im/sunrise-php/support)
[![Build Status](https://api.travis-ci.com/sunrise-php/http-factory.svg?branch=master)](https://travis-ci.com/sunrise-php/http-factory)
[![Build Status](https://scrutinizer-ci.com/g/sunrise-php/http-factory/badges/build.png?b=master)](https://scrutinizer-ci.com/g/sunrise-php/http-factory/build-status/master)
[![Latest Stable Version](https://poser.pugx.org/sunrise/http-factory/v/stable)](https://packagist.org/packages/sunrise/http-factory)
[![Total Downloads](https://poser.pugx.org/sunrise/http-factory/downloads)](https://packagist.org/packages/sunrise/http-factory)
[![License](https://poser.pugx.org/sunrise/http-factory/license)](https://packagist.org/packages/sunrise/http-factory)
Expand Down Expand Up @@ -38,10 +38,6 @@ use Sunrise\Http\Factory\UriFactory;
php vendor/bin/phpunit
```

## Api documentation

https://phpdoc.fenric.ru/

## Useful links

https://www.php-fig.org/psr/psr-17/
* https://www.php-fig.org/psr/psr-17/
29 changes: 19 additions & 10 deletions composer.json
@@ -1,9 +1,17 @@
{
"name": "sunrise/http-factory",
"description": "Sunrise HTTP factory for PHP 7.1+ based on PSR-17",
"keywords": ["fenric", "sunrise", "http", "http-factory", "psr-17"],
"homepage": "https://github.com/sunrise-php/http-factory",
"description": "Sunrise HTTP factory for PHP 7.1+ based on PSR-17",
"license": "MIT",
"keywords": [
"fenric",
"sunrise",
"http",
"http-factory",
"psr-17",
"php7",
"php8"
],
"authors": [
{
"name": "Anatoly Fenric",
Expand All @@ -12,15 +20,15 @@
}
],
"require": {
"php": "^7.1",
"sunrise/http-message": "^1.0.9",
"sunrise/http-server-request": "^1.0.5",
"sunrise/stream": "^1.0.15",
"sunrise/uri": "^1.0.19"
"php": "^7.1|^8.0",
"sunrise/http-message": "^1.4",
"sunrise/http-server-request": "^1.1",
"sunrise/stream": "^1.2",
"sunrise/uri": "^1.2"
},
"require-dev": {
"phpunit/phpunit": "7.5.6",
"http-interop/http-factory-tests": "0.5.0"
"phpunit/phpunit": "7.5.20|9.5.0",
"sunrise/coding-standard": "1.0.0"
},
"provide": {
"psr/http-factory-implementation": "1.0"
Expand All @@ -32,7 +40,8 @@
},
"scripts": {
"test": [
"phpunit --colors=always --coverage-text"
"phpunit --colors=always --coverage-text",
"phpcs"
]
}
}
7 changes: 7 additions & 0 deletions phpcs.xml.dist
@@ -0,0 +1,7 @@
<?xml version="1.0"?>
<ruleset name="Sunrise Coding Standard">
<rule ref="./vendor/sunrise/coding-standard/ruleset.xml"/>

<file>src</file>
<file>tests</file>
</ruleset>
3 changes: 0 additions & 3 deletions phpunit.xml.dist
Expand Up @@ -4,9 +4,6 @@
<testsuite name="Sunrise HTTP Factory Test Suite">
<directory>./tests/</directory>
</testsuite>
<testsuite name="Integration tests">
<directory>./vendor/http-interop/http-factory-tests/test</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
Expand Down
84 changes: 53 additions & 31 deletions tests/FactoryTest.php
@@ -1,7 +1,10 @@
<?php
<?php declare(strict_types=1);

namespace Sunrise\Http\Factory\Tests;

/**
* Import classes
*/
use PHPUnit\Framework\TestCase;
use Psr\Http\Message\RequestFactoryInterface;
use Psr\Http\Message\ResponseFactoryInterface;
Expand All @@ -16,47 +19,66 @@
use Sunrise\Http\Factory\UploadedFileFactory;
use Sunrise\Http\Factory\UriFactory;

/**
* FactoryTest
*/
class FactoryTest extends TestCase
{
public function testRequestFactory()
{
$factory = new RequestFactory();

$this->assertInstanceOf(RequestFactoryInterface::class, $factory);
}
/**
* @return void
*/
public function testRequestFactory() : void
{
$factory = new RequestFactory();

public function testResponseFactory()
{
$factory = new ResponseFactory();
$this->assertInstanceOf(RequestFactoryInterface::class, $factory);
}

$this->assertInstanceOf(ResponseFactoryInterface::class, $factory);
}
/**
* @return void
*/
public function testResponseFactory() : void
{
$factory = new ResponseFactory();

public function testServerRequestFactory()
{
$factory = new ServerRequestFactory();
$this->assertInstanceOf(ResponseFactoryInterface::class, $factory);
}

$this->assertInstanceOf(ServerRequestFactoryInterface::class, $factory);
}
public function testServerRequestFactory() : void
{
$factory = new ServerRequestFactory();

public function testStreamFactory()
{
$factory = new StreamFactory();
$this->assertInstanceOf(ServerRequestFactoryInterface::class, $factory);
}

$this->assertInstanceOf(StreamFactoryInterface::class, $factory);
}
/**
* @return void
*/
public function testStreamFactory() : void
{
$factory = new StreamFactory();

public function testUploadedFileFactory()
{
$factory = new UploadedFileFactory();
$this->assertInstanceOf(StreamFactoryInterface::class, $factory);
}

$this->assertInstanceOf(UploadedFileFactoryInterface::class, $factory);
}
/**
* @return void
*/
public function testUploadedFileFactory() : void
{
$factory = new UploadedFileFactory();

public function testUriFactory()
{
$factory = new UriFactory();
$this->assertInstanceOf(UploadedFileFactoryInterface::class, $factory);
}

$this->assertInstanceOf(UriFactoryInterface::class, $factory);
}
/**
* @return void
*/
public function testUriFactory() : void
{
$factory = new UriFactory();

$this->assertInstanceOf(UriFactoryInterface::class, $factory);
}
}

0 comments on commit 39c20a7

Please sign in to comment.