Skip to content

Instantly share code, notes, and snippets.

@pachico
Created May 2, 2016 19:41
Show Gist options
  • Save pachico/6501a3d7df70609c16cfa1605997de26 to your computer and use it in GitHub Desktop.
Save pachico/6501a3d7df70609c16cfa1605997de26 to your computer and use it in GitHub Desktop.
PhpAb\Engine\Engine
===============
The engine used to start tests.
* Class name: Engine
* Namespace: PhpAb\Engine
* This class implements: [PhpAb\Engine\EngineInterface](PhpAb-Engine-EngineInterface.md)
Properties
----------
### $tests
public array<mixed,\PhpAb\Test\Bag> $tests = array()
A list with test bags.
* Visibility: **public**
### $participationManager
private \PhpAb\Participation\ManagerInterface $participationManager
The participation manager used to check if a user particiaptes.
* Visibility: **private**
### $dispatcher
private \PhpAb\Event\DispatcherInterface $dispatcher
The event dispatcher that dispatches events related to tests.
* Visibility: **private**
### $filter
private \PhpAb\Participation\Filter\FilterInterface $filter
The default filter that is used when a test bag has no filter set.
* Visibility: **private**
### $chooser
private \PhpAb\Variant\Chooser\ChooserInterface $chooser
The default variant chooser that is used when a test bag has no variant chooser set.
* Visibility: **private**
### $locked
private boolean $locked = false
Locks the engine for further manipulaton
* Visibility: **private**
Methods
-------
### __construct
mixed PhpAb\Engine\Engine::__construct(\PhpAb\Participation\ManagerInterface $participationManager, \PhpAb\Event\DispatcherInterface $dispatcher, \PhpAb\Participation\Filter\FilterInterface|null $filter, \PhpAb\Variant\Chooser\ChooserInterface|null $chooser)
Initializes a new instance of this class.
* Visibility: **public**
#### Arguments
* $participationManager **[PhpAb\Participation\ManagerInterface](PhpAb-Participation-ManagerInterface.md)** - &lt;p&gt;Handles the Participation state&lt;/p&gt;
* $dispatcher **[PhpAb\Event\DispatcherInterface](PhpAb-Event-DispatcherInterface.md)** - &lt;p&gt;Dispatches events&lt;/p&gt;
* $filter **[PhpAb\Participation\Filter\FilterInterface](PhpAb-Participation-Filter-FilterInterface.md)|null** - &lt;p&gt;The default filter to use if no filter is provided for the test.&lt;/p&gt;
* $chooser **[PhpAb\Variant\Chooser\ChooserInterface](PhpAb-Variant-Chooser-ChooserInterface.md)|null** - &lt;p&gt;The default chooser to use if no chooser is provided for the test.&lt;/p&gt;
### getTests
array<mixed,\PhpAb\Test\TestInterface>|array PhpAb\Engine\EngineInterface::getTests()
Get all tests for the engine
* Visibility: **public**
* This method is defined by [PhpAb\Engine\EngineInterface](PhpAb-Engine-EngineInterface.md)
### getTest
\PhpAb\Test\TestInterface PhpAb\Engine\EngineInterface::getTest(string $test)
Get a test from the engine
* Visibility: **public**
* This method is defined by [PhpAb\Engine\EngineInterface](PhpAb-Engine-EngineInterface.md)
#### Arguments
* $test **string** - &lt;p&gt;The identifier of the test&lt;/p&gt;
### addTest
mixed PhpAb\Engine\EngineInterface::addTest(\PhpAb\Test\TestInterface $test, array $options, \PhpAb\Participation\Filter\FilterInterface $filter, \PhpAb\Variant\Chooser\ChooserInterface $chooser)
Adds a test to the Engine
* Visibility: **public**
* This method is defined by [PhpAb\Engine\EngineInterface](PhpAb-Engine-EngineInterface.md)
#### Arguments
* $test **[PhpAb\Test\TestInterface](PhpAb-Test-TestInterface.md)**
* $options **array**
* $filter **[PhpAb\Participation\Filter\FilterInterface](PhpAb-Participation-Filter-FilterInterface.md)**
* $chooser **[PhpAb\Variant\Chooser\ChooserInterface](PhpAb-Variant-Chooser-ChooserInterface.md)**
### start
null PhpAb\Engine\EngineInterface::start()
Starts the tests
* Visibility: **public**
* This method is defined by [PhpAb\Engine\EngineInterface](PhpAb-Engine-EngineInterface.md)
### handleTestBag
boolean PhpAb\Engine\Engine::handleTestBag(\PhpAb\Test\Bag $bag)
Process the test bag
* Visibility: **private**
#### Arguments
* $bag **[PhpAb\Test\Bag](PhpAb-Test-Bag.md)**
### activateVariant
mixed PhpAb\Engine\Engine::activateVariant(\PhpAb\Test\Bag $bag, \PhpAb\Variant\VariantInterface $variant)
* Visibility: **private**
#### Arguments
* $bag **[PhpAb\Test\Bag](PhpAb-Test-Bag.md)**
* $variant **[PhpAb\Variant\VariantInterface](PhpAb-Variant-VariantInterface.md)**
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment