for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Basis;
use PHPUnit\Framework\TestCase;
use Tarantool\Mapper\Mapper;
class Test extends TestCase
{
public function setup()
$root = getcwd();
$service = getenv('SERVICE_NAME') ?: basename($root);
$host = getenv('TARANTOOL_SERVICE_HOST') ?: '127.0.0.1';
$port = getenv('TARANTOOL_SERVICE_PORT') ?: '3302';
$this->app = new Application($root);
app
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
class MyClass { } $x = new MyClass(); $x->foo = true;
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:
class MyClass { public $foo; } $x = new MyClass(); $x->foo = true;
$this->get(Config::class)['service'] = $service;
$this->get(Config::class)['tarantool'] = "tcp://$host:$port";
$this->dispatch('tarantool.migrate');
}
public function dispatch($job, $params = [])
return $this->app->dispatch($job, $params);
public function get($class)
return $this->app->get($class);
public function getMapper()
return $this->get(Mapper::class);
public function find($space, $params = [])
return $this->getMapper()->find($space, $params);
public function findOne($space, $params = [])
return $this->getMapper()->findOne($space, $params);
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: