public function testClient()
 {
     //Testing version string
     $this->assertTrue(is_string(\SplitIO\version()));
     $parameters = array('scheme' => 'redis', 'host' => REDIS_HOST, 'port' => REDIS_PORT, 'timeout' => 881);
     $options = array();
     $sdkConfig = ['log' => ['adapter' => 'stdout', 'level' => 'info'], 'cache' => array('adapter' => 'predis', 'parameters' => $parameters, 'options' => $options)];
     //Initializing the SDK instance.
     $splitFactory = \SplitIO\Sdk::factory('some-api-key', $sdkConfig);
     $splitSdk = $splitFactory->client();
     //Populating the cache.
     $this->addSplitsInCache();
     $this->addSegmentsInCache();
     //Assertions
     $this->inOperator($splitSdk);
     $this->equalToOperator($splitSdk);
     $this->greaterThanOrEqualToOperator($splitSdk);
     $this->lessThanOrEqualToOperator($splitSdk);
     $this->betweenOperator($splitSdk);
 }
Beispiel #2
0
 public function testInvalidCacheAdapter()
 {
     $this->setExpectedException(\SplitIO\Exception\Exception::class);
     $sdkConfig = array('log' => array('adapter' => 'stdout'), 'cache' => array('adapter' => 'invalidAdapter'));
     //Initializing the SDK instance.
     \SplitIO\Sdk::factory('asdqwe123456', $sdkConfig);
 }