Download the PHP package calderawp/caldera-interop-fixture without Composer
On this page you can find all versions of the php package calderawp/caldera-interop-fixture. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package caldera-interop-fixture
Auto-magic tests for caldera-interop Interoperable Servies
Why?
- Every interoperable set MUST transform between array/entitiy/model/collection/HTTP message/ etc. consistently.
- We can only trust that claim if we test a reasonable approximation of all of the possible combination of values for an entity's properties.
- Writing all those tests takes to long.
Install
composer require calderawp/caldera-interop-fixture --dev
Requires
- PHP 7.1
Status
BETA
Usage
This testing component is designed to be used with interoperable sets that are provided to the container using a InteropProvider
. This component is comprised of two parts.
Fixture and Prop Description
The InteropFixture
class takes an array-like set of data PropData
that describes the properties and possible values of an entity. The PropData
is the least auto-magic part of this process.
PropData
For each property, we provide that property's name and an array of values. For example, to add a xpLevel
prop:
The values
index collects arrays that provides an input value and an expected output value. For example, to test that the absolute value of our property is always returned:
Completer example:
InteropFixture
Using In Tests
Complete Example
See Tests/example for an example interoperable set that is tested in by the test in tests/Unit/HelloInteropTest. This example has two properites. Both with custom validation logic. 64 assertions are generated for this set.
Development
Install
Requires git and Composer
git clone [email protected]:calderawp/caldera-interop-fixture.git
cd caldera-interop-fixture
composer install
Coding Standard: Caldera (psr2 with tabs). Enforces using phpcs.
Testing
Tests are divided between unit tests and currently no other types of tests.
Install
All testing dependencies are installed with composer.
Use
Run these commands from the plugin's root directory.
- Run All Tests and Code Formatting
composer tests
- Includes lints, unit tests and fixes documented below
- Run Unit Tests
composer unit-tests
- Unit tests are located in
/Tests/Unit
- Fix All Code Formatting
composer formatting
- Runs code sniffs and code fixes and lints.
Stuff.
Copyright 2018 CalderaWP LLC. License: GPL v2 or later.