Completed
Push — master ( eedd5f...ad9185 )
by Dmitry
05:03
created

TarantoolTest::test()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 14
rs 9.4285
cc 1
eloc 9
nc 1
nop 0
1
<?php
2
3
use Tarantool\Mapper\Mapper;
4
5
class TarantoolTest extends TestSuite
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
6
{
7
    function test()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
8
    {
9
        $this->app->dispatch('tarantool.migrate');
0 ignored issues
show
Bug introduced by
The property app does not exist. Did you maybe forget to declare it?

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;
Loading history...
10
11
        $mapper = $this->app->get(Mapper::class);
12
        $note = $mapper->getRepository('note')->create('zzz');
13
        $this->assertSame($note->message, 'zzz');
14
15
        $note->message = 'test';
16
        $note->save();
17
18
        $this->assertNotNull($note->id);
19
        $this->assertSame($note->message, 'test');
20
    }
21
}
22