public function setUp() { parent::setUp(); $this->formatter = new Formatter(new History()); Type::create(['id' => '1', 'name' => 'Постанова']); Type::create(['id' => '2', 'name' => 'Кодекс України']); Type::create(['id' => '3', 'name' => 'Узагальнення судової практики']); Type::create(['id' => '4', 'name' => 'Міжнародний документ']); }
public function setUp() { parent::setUp(); $this->obj = $this->app->make('command.lawgrabber.download'); $this->db()->table('law_issuers')->truncate(); $this->db()->table('law_types')->truncate(); $this->db()->table('law_revisions')->truncate(); $this->db()->table('jobs')->truncate(); $this->db()->table('laws')->truncate(); $this->db()->table('issuers')->insert(['id' => 'o1', 'name' => 'Верховна Рада України', 'full_name' => '123', 'group_name' => '123', 'website' => '123', 'url' => '123', 'international' => 0]); Type::create(['id' => 'o1', 'name' => 'Закон'])->save(); Type::create(['id' => 'o2', 'name' => 'Конституція'])->save(); State::create(['id' => 'o5', 'name' => 'Чинний'])->save(); }
/** * @dataProvider types */ public function testGetRid($name, $expected) { $type = new Type(['id' => 'fake', 'name' => $name]); $this->assertEquals($expected, $type->getRid()); }