Esempio n. 1
0
 /**
  * @covers Pachico\Abtest\Engine::track
  */
 public function testTrack()
 {
     $tracking = m::mock('Pachico\\Abtest\\Tracking\\TrackingInterface');
     $tracking->shouldReceive('track')->andReturn(true);
     $configurator = new Config\Chainable(null, $tracking);
     $this->object = new Engine($configurator);
     $this->assertTrue($this->object->track());
 }
Esempio n. 2
0
<?php

/**
 * @author Mariano F.co Benítez Mulet <*****@*****.**>
 * @copyright (c) 2016, Mariano F.co Benítez Mulet
 */
use Pachico\Abtest;
require __DIR__ . '/../vendor/autoload.php';
// Let's store in Redis a key with split to see it running
// Uncomment the following two lines to set them
// $redis = new Abtest\Util\RedisConnector('127.0.0.1');
// $redis->set('ABTESTS:test_key', json_encode([50, 50]));
$abtest_engine = new Abtest\Engine(new Abtest\Config\FromArray(__DIR__ . '/configuration/redis_split.php'));
?>

<html>
	<body style="color: #353535; margin: 30px; font-family: Arial;">
		<h1>Simple test</h1>
		<p>These tests use cookies as Memory. Delete cookies to see these values change.</p>

		<?php 
if ($abtest_engine->getTest('image_test')->isParticipant()) {
    ?>

			<h2>I participate in Image AB test</h2>

			<?php 
    if (0 === $abtest_engine->getTest('image_test')->getVersion()) {
        ?>

				<div>