/** * @covers Pachico\Abtest\Config\Configuration::getTestByName */ public function testGetTestByName() { $test = new Test\Test('foo', new Split\ArrayProbability([50, 50]), new Memory\Cookie('foo')); $this->object->addTest($test); $this->assertSame($test, $this->object->getTestByName('foo')); $this->assertNull($this->object->getTestByName('bar')); }
/** * * @param string $name * @param \Pachico\Abtest\Split\SplitInterface $split * @param \Pachico\Abtest\Segmentation\SegmentatIoninterface $segmentation * @param string $tracking_id */ public function addTest($name, Split\SplitInterface $split, Segmentation\SegmentatIoninterface $segmentation = null, $tracking_id = null) { $test_object = new Test\Test($name, $split, $this->_configuration->getMemory(), $segmentation, $tracking_id); $this->_configuration->addTest($test_object); return $this; }