Skip to content

A/B test data for EXADS tech test

License

Notifications You must be signed in to change notification settings

EXADS/ab-test-data

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A/B Test Data

In order to use this library:

  1. Install it using composer:
composer require exads/ab-test-data
  1. Use it in your class:
<?php

namespace MyNamespace;

use Exads\ABTestData;

class MyClass
{
  public function getData(int $promoId): array
  {
    $abTest = new ABTestData($promoId);
    $promotion = $abTest->getPromotionName();
    $designs = $abTest->getAllDesigns();
    // ...
    return array_map(function ($item) {
      // ...
    }, $designs);
  }
}

There are 3 A/B Test promotions that can be accessed via this class. Feel free to use any of them (1, 2, 3).

Designs come in the following format:

$designs = [
  [ 'designId' => 1, 'designName' => 'Design 1', 'splitPercent' => 35 ],
  // [ ... ]
];