diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..8da4166 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,76 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at . All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see +https://www.contributor-covenant.org/faq \ No newline at end of file diff --git a/COPYRIGHT b/COPYRIGHT new file mode 100644 index 0000000..670a3d3 --- /dev/null +++ b/COPYRIGHT @@ -0,0 +1 @@ +(c) 2019 - 2020 CROSS Solution (https://cross-solution.de) diff --git a/LICENSE b/LICENSE index 3884e7b..749428e 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2019 CROSS Solution +Copyright (c) 2019 - 2020 CROSS Solution Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/src/Constraint/ExtendsOrImplements.php b/src/Constraint/ExtendsOrImplements.php index e277b6c..40f8d16 100644 --- a/src/Constraint/ExtendsOrImplements.php +++ b/src/Constraint/ExtendsOrImplements.php @@ -1,10 +1,11 @@ + * @see https://github.com/cross-solution/phpunit-utils for the canonical source repository + * @copyright https://github.com/cross-solution/phpunit-utils/blob/master/COPYRIGHT + * @license https://github.com/cross-solution/phpunit-utils/blob/master/LICENSE MIT */ declare(strict_types=1); @@ -17,7 +18,6 @@ * Constraint to assert the extending or implementing of specific classes and interfaces. * * @author Mathias Gelhausen - * @todo write tets. */ class ExtendsOrImplements extends BaseConstraint { diff --git a/src/Constraint/UsesTraits.php b/src/Constraint/UsesTraits.php index 790bb7a..8afa2d4 100644 --- a/src/Constraint/UsesTraits.php +++ b/src/Constraint/UsesTraits.php @@ -1,10 +1,11 @@ + * @see https://github.com/cross-solution/phpunit-utils for the canonical source repository + * @copyright https://github.com/cross-solution/phpunit-utils/blob/master/COPYRIGHT + * @license https://github.com/cross-solution/phpunit-utils/blob/master/LICENSE MIT */ declare(strict_types=1); diff --git a/src/Exception/ExceptionInterface.php b/src/Exception/ExceptionInterface.php index 065d64e..5bc07fa 100644 --- a/src/Exception/ExceptionInterface.php +++ b/src/Exception/ExceptionInterface.php @@ -1,10 +1,11 @@ - * @license MIT + * @see https://github.com/cross-solution/phpunit-utils for the canonical source repository + * @copyright https://github.com/cross-solution/phpunit-utils/blob/master/COPYRIGHT + * @license https://github.com/cross-solution/phpunit-utils/blob/master/LICENSE MIT */ declare(strict_types=1); diff --git a/src/Exception/InvalidUsageException.php b/src/Exception/InvalidUsageException.php index 955e7fe..7ac37aa 100644 --- a/src/Exception/InvalidUsageException.php +++ b/src/Exception/InvalidUsageException.php @@ -1,10 +1,11 @@ - * @license MIT + * @see https://github.com/cross-solution/phpunit-utils for the canonical source repository + * @copyright https://github.com/cross-solution/phpunit-utils/blob/master/COPYRIGHT + * @license https://github.com/cross-solution/phpunit-utils/blob/master/LICENSE MIT */ declare(strict_types=1); @@ -15,7 +16,6 @@ * Exception thrown if a helper trait is used the wrong way * * @author Mathias Gelhausen - * @todo write tests */ class InvalidUsageException extends \PHPUnit\Framework\Exception implements ExceptionInterface { diff --git a/src/Exception/TemplatedMessageExceptionTrait.php b/src/Exception/TemplatedMessageExceptionTrait.php index 9950c4d..bd3d628 100644 --- a/src/Exception/TemplatedMessageExceptionTrait.php +++ b/src/Exception/TemplatedMessageExceptionTrait.php @@ -1,10 +1,11 @@ - * @license MIT + * @see https://github.com/cross-solution/phpunit-utils for the canonical source repository + * @copyright https://github.com/cross-solution/phpunit-utils/blob/master/COPYRIGHT + * @license https://github.com/cross-solution/phpunit-utils/blob/master/LICENSE MIT */ declare(strict_types=1); @@ -32,7 +33,7 @@ trait TemplatedMessageExceptionTrait * * @return \Exception */ - public static function create(...$args): \Exception + public static function create(...$args): self { $ex = end($args) instanceof \Throwable ? array_pop($args) : null; $message = sprintf(...$args); diff --git a/src/TestCase/AssertInheritanceTrait.php b/src/TestCase/AssertInheritanceTrait.php index 9bc6efa..28569a9 100644 --- a/src/TestCase/AssertInheritanceTrait.php +++ b/src/TestCase/AssertInheritanceTrait.php @@ -1,10 +1,11 @@ + * @see https://github.com/cross-solution/phpunit-utils for the canonical source repository + * @copyright https://github.com/cross-solution/phpunit-utils/blob/master/COPYRIGHT + * @license https://github.com/cross-solution/phpunit-utils/blob/master/LICENSE MIT */ declare(strict_types=1); diff --git a/src/TestCase/AssertUsesTraitsTrait.php b/src/TestCase/AssertUsesTraitsTrait.php index 46ec5a4..0a4e26d 100644 --- a/src/TestCase/AssertUsesTraitsTrait.php +++ b/src/TestCase/AssertUsesTraitsTrait.php @@ -1,10 +1,11 @@ + * @see https://github.com/cross-solution/phpunit-utils for the canonical source repository + * @copyright https://github.com/cross-solution/phpunit-utils/blob/master/COPYRIGHT + * @license https://github.com/cross-solution/phpunit-utils/blob/master/LICENSE MIT */ declare(strict_types=1); diff --git a/src/TestCase/ContainerDoubleTrait.php b/src/TestCase/ContainerDoubleTrait.php index 0b6e646..b16627a 100644 --- a/src/TestCase/ContainerDoubleTrait.php +++ b/src/TestCase/ContainerDoubleTrait.php @@ -1,10 +1,11 @@ + * @see https://github.com/cross-solution/phpunit-utils for the canonical source repository + * @copyright https://github.com/cross-solution/phpunit-utils/blob/master/COPYRIGHT + * @license https://github.com/cross-solution/phpunit-utils/blob/master/LICENSE MIT */ declare(strict_types=1); diff --git a/src/TestCase/CreateProphecyTrait.php b/src/TestCase/CreateProphecyTrait.php index 7037bad..8a18637 100644 --- a/src/TestCase/CreateProphecyTrait.php +++ b/src/TestCase/CreateProphecyTrait.php @@ -1,10 +1,11 @@ - * @license MIT + * @see https://github.com/cross-solution/phpunit-utils for the canonical source repository + * @copyright https://github.com/cross-solution/phpunit-utils/blob/master/COPYRIGHT + * @license https://github.com/cross-solution/phpunit-utils/blob/master/LICENSE MIT */ declare(strict_types=1); @@ -18,7 +19,6 @@ * Creates object prophecies or doubles. * * @author Mathias Gelhausen - * @todo write tests */ trait CreateProphecyTrait { diff --git a/src/TestCase/SetupTargetTrait.php b/src/TestCase/SetupTargetTrait.php index 7958c3a..584248a 100644 --- a/src/TestCase/SetupTargetTrait.php +++ b/src/TestCase/SetupTargetTrait.php @@ -1,9 +1,11 @@ + * @see https://github.com/cross-solution/phpunit-utils for the canonical source repository + * @copyright https://github.com/cross-solution/phpunit-utils/blob/master/COPYRIGHT + * @license https://github.com/cross-solution/phpunit-utils/blob/master/LICENSE MIT */ declare(strict_types=1); diff --git a/src/TestCase/TestInheritanceTrait.php b/src/TestCase/TestInheritanceTrait.php index 6e39117..fcdf2a9 100644 --- a/src/TestCase/TestInheritanceTrait.php +++ b/src/TestCase/TestInheritanceTrait.php @@ -1,10 +1,11 @@ + * @see https://github.com/cross-solution/phpunit-utils for the canonical source repository + * @copyright https://github.com/cross-solution/phpunit-utils/blob/master/COPYRIGHT + * @license https://github.com/cross-solution/phpunit-utils/blob/master/LICENSE MIT */ declare(strict_types=1); diff --git a/src/TestCase/TestSetterAndGetterTrait.php b/src/TestCase/TestSetterAndGetterTrait.php index fb653c4..5ca1518 100644 --- a/src/TestCase/TestSetterAndGetterTrait.php +++ b/src/TestCase/TestSetterAndGetterTrait.php @@ -1,10 +1,11 @@ + * @see https://github.com/cross-solution/phpunit-utils for the canonical source repository + * @copyright https://github.com/cross-solution/phpunit-utils/blob/master/COPYRIGHT + * @license https://github.com/cross-solution/phpunit-utils/blob/master/LICENSE MIT */ declare(strict_types=1); @@ -99,7 +100,7 @@ * * @author Mathias Gelhausen * - * @since @#next#@ Allow SUT per individual test. + * @since 2.x Allow SUT per individual test. */ trait TestSetterAndGetterTrait { diff --git a/src/TestCase/TestUsesTraitsTrait.php b/src/TestCase/TestUsesTraitsTrait.php index 1fb8d16..60723b4 100644 --- a/src/TestCase/TestUsesTraitsTrait.php +++ b/src/TestCase/TestUsesTraitsTrait.php @@ -1,10 +1,11 @@ + * @see https://github.com/cross-solution/phpunit-utils for the canonical source repository + * @copyright https://github.com/cross-solution/phpunit-utils/blob/master/COPYRIGHT + * @license https://github.com/cross-solution/phpunit-utils/blob/master/LICENSE MIT */ declare(strict_types=1); diff --git a/src/Utils/Instance.php b/src/Utils/Instance.php index fc56dca..7975046 100644 --- a/src/Utils/Instance.php +++ b/src/Utils/Instance.php @@ -1,10 +1,11 @@ - * @license MIT + * @see https://github.com/cross-solution/phpunit-utils for the canonical source repository + * @copyright https://github.com/cross-solution/phpunit-utils/blob/master/COPYRIGHT + * @license https://github.com/cross-solution/phpunit-utils/blob/master/LICENSE MIT */ declare(strict_types=1); diff --git a/src/Utils/Target.php b/src/Utils/Target.php index a265070..ad5148b 100644 --- a/src/Utils/Target.php +++ b/src/Utils/Target.php @@ -1,10 +1,11 @@ - * @license MIT + * @see https://github.com/cross-solution/phpunit-utils for the canonical source repository + * @copyright https://github.com/cross-solution/phpunit-utils/blob/master/COPYRIGHT + * @license https://github.com/cross-solution/phpunit-utils/blob/master/LICENSE MIT */ declare(strict_types=1); diff --git a/test/TestUtilsTest/Constraint/ExtendsOrImplementsTest.php b/test/TestUtilsTest/Constraint/ExtendsOrImplementsTest.php index b659bc6..1cf5e76 100644 --- a/test/TestUtilsTest/Constraint/ExtendsOrImplementsTest.php +++ b/test/TestUtilsTest/Constraint/ExtendsOrImplementsTest.php @@ -1,10 +1,11 @@ + * @see https://github.com/cross-solution/phpunit-utils for the canonical source repository + * @copyright https://github.com/cross-solution/phpunit-utils/blob/master/COPYRIGHT + * @license https://github.com/cross-solution/phpunit-utils/blob/master/LICENSE MIT */ declare(strict_types=1); diff --git a/test/TestUtilsTest/Constraint/UsesTraitsTest.php b/test/TestUtilsTest/Constraint/UsesTraitsTest.php index eae39db..079c1d4 100644 --- a/test/TestUtilsTest/Constraint/UsesTraitsTest.php +++ b/test/TestUtilsTest/Constraint/UsesTraitsTest.php @@ -1,10 +1,11 @@ + * @see https://github.com/cross-solution/phpunit-utils for the canonical source repository + * @copyright https://github.com/cross-solution/phpunit-utils/blob/master/COPYRIGHT + * @license https://github.com/cross-solution/phpunit-utils/blob/master/LICENSE MIT */ /** */ diff --git a/test/TestUtilsTest/Exception/InvalidUsageExceptionTest.php b/test/TestUtilsTest/Exception/InvalidUsageExceptionTest.php index b863f91..513018f 100644 --- a/test/TestUtilsTest/Exception/InvalidUsageExceptionTest.php +++ b/test/TestUtilsTest/Exception/InvalidUsageExceptionTest.php @@ -1,10 +1,11 @@ - * @license MIT + * @see https://github.com/cross-solution/phpunit-utils for the canonical source repository + * @copyright https://github.com/cross-solution/phpunit-utils/blob/master/COPYRIGHT + * @license https://github.com/cross-solution/phpunit-utils/blob/master/LICENSE MIT */ declare(strict_types=1); diff --git a/test/TestUtilsTest/Exception/TemplatedMessageExceptionTraitTest.php b/test/TestUtilsTest/Exception/TemplatedMessageExceptionTraitTest.php index a18cb3a..631c1a8 100644 --- a/test/TestUtilsTest/Exception/TemplatedMessageExceptionTraitTest.php +++ b/test/TestUtilsTest/Exception/TemplatedMessageExceptionTraitTest.php @@ -1,10 +1,11 @@ - * @license MIT + * @see https://github.com/cross-solution/phpunit-utils for the canonical source repository + * @copyright https://github.com/cross-solution/phpunit-utils/blob/master/COPYRIGHT + * @license https://github.com/cross-solution/phpunit-utils/blob/master/LICENSE MIT */ declare(strict_types=1); diff --git a/test/TestUtilsTest/TestCase/AssertInheritanceTraitTest.php b/test/TestUtilsTest/TestCase/AssertInheritanceTraitTest.php index 7f5ab02..fed9254 100644 --- a/test/TestUtilsTest/TestCase/AssertInheritanceTraitTest.php +++ b/test/TestUtilsTest/TestCase/AssertInheritanceTraitTest.php @@ -1,10 +1,11 @@ + * @see https://github.com/cross-solution/phpunit-utils for the canonical source repository + * @copyright https://github.com/cross-solution/phpunit-utils/blob/master/COPYRIGHT + * @license https://github.com/cross-solution/phpunit-utils/blob/master/LICENSE MIT */ declare(strict_types=1); diff --git a/test/TestUtilsTest/TestCase/AssertUsesTraitsTraitTest.php b/test/TestUtilsTest/TestCase/AssertUsesTraitsTraitTest.php index 8a2eca3..0ef9ee8 100644 --- a/test/TestUtilsTest/TestCase/AssertUsesTraitsTraitTest.php +++ b/test/TestUtilsTest/TestCase/AssertUsesTraitsTraitTest.php @@ -1,10 +1,11 @@ + * @see https://github.com/cross-solution/phpunit-utils for the canonical source repository + * @copyright https://github.com/cross-solution/phpunit-utils/blob/master/COPYRIGHT + * @license https://github.com/cross-solution/phpunit-utils/blob/master/LICENSE MIT */ declare(strict_types=1); diff --git a/test/TestUtilsTest/TestCase/ContainerDoubleTraitTest.php b/test/TestUtilsTest/TestCase/ContainerDoubleTraitTest.php index 44a0021..62a0eab 100644 --- a/test/TestUtilsTest/TestCase/ContainerDoubleTraitTest.php +++ b/test/TestUtilsTest/TestCase/ContainerDoubleTraitTest.php @@ -1,10 +1,11 @@ + * @see https://github.com/cross-solution/phpunit-utils for the canonical source repository + * @copyright https://github.com/cross-solution/phpunit-utils/blob/master/COPYRIGHT + * @license https://github.com/cross-solution/phpunit-utils/blob/master/LICENSE MIT */ declare(strict_types=1); @@ -314,6 +315,7 @@ public function testCreatesContainerProphecyWithOptions(array $services, array $ public function testThrowsExceptionIfInterfaceOrClassIsNotDefined() { + /** @var \phpmock\prophecy\FunctionProphecy $func */ $func = (new PHPProphet)->prophesize('Cross\TestUtils\TestCase'); $func->interface_exists(Argument::any())->willReturn(false); $func->class_exists(Argument::any())->willReturn(false); diff --git a/test/TestUtilsTest/TestCase/CreateProphecyTraitTest.php b/test/TestUtilsTest/TestCase/CreateProphecyTraitTest.php index a8f8c94..f038493 100644 --- a/test/TestUtilsTest/TestCase/CreateProphecyTraitTest.php +++ b/test/TestUtilsTest/TestCase/CreateProphecyTraitTest.php @@ -1,10 +1,11 @@ - * @license MIT + * @see https://github.com/cross-solution/phpunit-utils for the canonical source repository + * @copyright https://github.com/cross-solution/phpunit-utils/blob/master/COPYRIGHT + * @license https://github.com/cross-solution/phpunit-utils/blob/master/LICENSE MIT */ declare(strict_types=1); diff --git a/test/TestUtilsTest/TestCase/SetupTargetTraitTest.php b/test/TestUtilsTest/TestCase/SetupTargetTraitTest.php index 8a5c59d..e36cd73 100644 --- a/test/TestUtilsTest/TestCase/SetupTargetTraitTest.php +++ b/test/TestUtilsTest/TestCase/SetupTargetTraitTest.php @@ -1,10 +1,11 @@ + * @see https://github.com/cross-solution/phpunit-utils for the canonical source repository + * @copyright https://github.com/cross-solution/phpunit-utils/blob/master/COPYRIGHT + * @license https://github.com/cross-solution/phpunit-utils/blob/master/LICENSE MIT */ declare(strict_types=1); diff --git a/test/TestUtilsTest/TestCase/TestInheritanceTraitTest.php b/test/TestUtilsTest/TestCase/TestInheritanceTraitTest.php index 4e9adc2..be88cdb 100644 --- a/test/TestUtilsTest/TestCase/TestInheritanceTraitTest.php +++ b/test/TestUtilsTest/TestCase/TestInheritanceTraitTest.php @@ -1,10 +1,11 @@ + * @see https://github.com/cross-solution/phpunit-utils for the canonical source repository + * @copyright https://github.com/cross-solution/phpunit-utils/blob/master/COPYRIGHT + * @license https://github.com/cross-solution/phpunit-utils/blob/master/LICENSE MIT */ declare(strict_types=1); diff --git a/test/TestUtilsTest/TestCase/TestSetterAndGetterTrait/SpecifyExpectedValueTest.php b/test/TestUtilsTest/TestCase/TestSetterAndGetterTrait/SpecifyExpectedValueTest.php index a95577e..90dd9ff 100644 --- a/test/TestUtilsTest/TestCase/TestSetterAndGetterTrait/SpecifyExpectedValueTest.php +++ b/test/TestUtilsTest/TestCase/TestSetterAndGetterTrait/SpecifyExpectedValueTest.php @@ -1,11 +1,11 @@ - * @license MIT + * @see https://github.com/cross-solution/phpunit-utils for the canonical source repository + * @copyright https://github.com/cross-solution/phpunit-utils/blob/master/COPYRIGHT + * @license https://github.com/cross-solution/phpunit-utils/blob/master/LICENSE MIT */ declare(strict_types=1); diff --git a/test/TestUtilsTest/TestCase/TestSetterAndGetterTraitTest.php b/test/TestUtilsTest/TestCase/TestSetterAndGetterTraitTest.php index b0c0d54..9b28b0e 100644 --- a/test/TestUtilsTest/TestCase/TestSetterAndGetterTraitTest.php +++ b/test/TestUtilsTest/TestCase/TestSetterAndGetterTraitTest.php @@ -1,10 +1,11 @@ + * @see https://github.com/cross-solution/phpunit-utils for the canonical source repository + * @copyright https://github.com/cross-solution/phpunit-utils/blob/master/COPYRIGHT + * @license https://github.com/cross-solution/phpunit-utils/blob/master/LICENSE MIT */ declare(strict_types=1); diff --git a/test/TestUtilsTest/TestCase/TestUsesTraitsTraitTest.php b/test/TestUtilsTest/TestCase/TestUsesTraitsTraitTest.php index 62ea27f..f6718c7 100644 --- a/test/TestUtilsTest/TestCase/TestUsesTraitsTraitTest.php +++ b/test/TestUtilsTest/TestCase/TestUsesTraitsTraitTest.php @@ -1,10 +1,11 @@ + * @see https://github.com/cross-solution/phpunit-utils for the canonical source repository + * @copyright https://github.com/cross-solution/phpunit-utils/blob/master/COPYRIGHT + * @license https://github.com/cross-solution/phpunit-utils/blob/master/LICENSE MIT */ declare(strict_types=1); diff --git a/test/TestUtilsTest/Utils/InstanceTest.php b/test/TestUtilsTest/Utils/InstanceTest.php index a8708e3..704e59d 100644 --- a/test/TestUtilsTest/Utils/InstanceTest.php +++ b/test/TestUtilsTest/Utils/InstanceTest.php @@ -1,10 +1,11 @@ - * @license MIT + * @see https://github.com/cross-solution/phpunit-utils for the canonical source repository + * @copyright https://github.com/cross-solution/phpunit-utils/blob/master/COPYRIGHT + * @license https://github.com/cross-solution/phpunit-utils/blob/master/LICENSE MIT */ declare(strict_types=1); diff --git a/test/TestUtilsTest/Utils/TargetTest.php b/test/TestUtilsTest/Utils/TargetTest.php index ddd8fd1..c833b08 100644 --- a/test/TestUtilsTest/Utils/TargetTest.php +++ b/test/TestUtilsTest/Utils/TargetTest.php @@ -1,10 +1,11 @@ - * @license MIT + * @see https://github.com/cross-solution/phpunit-utils for the canonical source repository + * @copyright https://github.com/cross-solution/phpunit-utils/blob/master/COPYRIGHT + * @license https://github.com/cross-solution/phpunit-utils/blob/master/LICENSE MIT */ declare(strict_types=1); @@ -69,10 +70,6 @@ public function testGetTargetInstanceFromClassesPropertyFirstItem() $target = new class { public $classes = ['TestTarget', 'other', 'values']; - public function test() - { - return $this->getTargetInstance([], [], 'classes'); - } }; $actual = Target::get($target, [], [], 'classes');