library craft-unit-test-suite
A library that helps you mocking Craft database/model classes
nerds-and-company/craft-unit-test-suite
A library that helps you mocking Craft database/model classes
- Thursday, November 26, 2015
- by nerds-and-company
- Repository
- 3 Watchers
- 2 Stars
- 3,582 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 1 Forks
- 0 Open issues
- 3 Versions
- 10 % Grown
Unit Test Suite
PHPUnit test suit helps you with mocking several craft services and classes., (*1)
It enable you to:, (*2)
- Configure any abstract classes you wish to load before running unit tests
- Save time by not having to manually mock Craft's database models and it's required classes
- Simply override or add extra methods to the mocked classes mocked in UnitTestSuite_AbstractTest
Requirements:
Installation:
The library can be installed using Composer., (*3)
composer require nerds-and-company/unit-test-suite ~1.0.0
Classes:
The library is composed of two classes:, (*4)
-
UnitTestSuite_AbstractTest is the abstract class you can extend that contains the mocked Craft database classes
-
AbstractTestLoader is used to load custom abstract classes that for example extend UnitTestSuite_AbstractTest and add extra functionality
Usage
- Make sure the phpunit bootstrap points at
bootstrap="vendor/unittestsuite/src/bootstrap.php
- Copy the
unittestsuite.yml supplied with this package /craft/config and add extra (abstract) classes you wish to pre-load
- Extend
UnitTestSuite_AbstractTest and override or add extra data to the returned mocks
- Calling $this->mockCraftDb() should cover most of the Craft DB methods
dev-master
9999999-dev
A library that helps you mocking Craft database/model classes
Sources
Download
MIT
The Requires
database
phpunit
model
craft
dbcommand
1.0.1
1.0.1.0
A library that helps you mocking Craft database/model classes
Sources
Download
MIT
The Requires
database
phpunit
model
craft
dbcommand
1.0.0
1.0.0.0
A library that helps you mocking Craft database/model classes
Sources
Download
MIT
The Requires
database
phpunit
model
craft
dbcommand