Commit 7aec53d2 authored by Mark Harding's avatar Mark Harding Committed by Mark Harding

(experiment): setup experiment for Homepage200619

parent 0e1180af
No related merge requests found
Pipeline #67146840 passed with stages
in 6 minutes and 29 seconds
......@@ -70,8 +70,8 @@ class register implements Interfaces\Api, Interfaces\ApiIgnorePam
$user = register_user($_POST['username'], $_POST['password'], $_POST['username'], $_POST['email'], false);
$guid = $user->guid;
if (isset($_POST['Homepage121118'])) {
$user->expHomepage121818 = $_POST['Homepage121118'];
if (isset($_POST['Homepage200619'])) {
$user->expHomepage200619 = $_POST['Homepage200619'];
$user->save();
}
......
<?php
/**
*
*/
namespace Minds\Core\Experiments\Hypotheses;
use Minds\Core\Experiments\Bucket;
class Homepage200619 implements HypothesisInterface
{
/**
* Return the id for the hypothesis
* @return string
*/
public function getId()
{
return "Homepage200619";
}
/**
* Return the buckets for the hypothesis
* @return Bucket[]
*/
public function getBuckets()
{
return [
(new Bucket)
->setId('base')
->setWeight(75),
(new Bucket)
->setId('variant1')
->setWeight(25), //25 pct of users will be in this bucket
];
}
}
\ No newline at end of file
......@@ -18,6 +18,7 @@ class Manager
/** @param array $experiments */
private $experiments = [
'Homepage121118' => Hypotheses\Homepage121118::class,
'Homepage200619' => Hypotheses\Homepage200619::class,
];
public function __construct($sampler = null)
......
......@@ -20,7 +20,7 @@ class ManagerSpec extends ObjectBehavior
function it_should_return_a_list_of_experiments()
{
$this->getExperiments()->shouldHaveCount(1);
$this->getExperiments()->shouldHaveCount(2);
}
function it_should_return_bucket_for_experiment(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment