Level 47
Extract the common parts out to methods:
class B_Test
{
public function create_something_1()
{
$this->doSomething();
$this->seeInDatabase('something_1', ['name' => 'Name']);
}
public function create_something_2()
{
$data = $this->doSomething();
$this->visit('/b/create')
->select($a->id, 'something_1')
->type('New Name','name')
->press('Submit')
->seeInDatabase('something_2', ['name' => 'New Name']);
}
protected function doSomething()
{
$this->visit('/a/create')
->type('Name','name')
->press('Submit');
return \App\Models\Something1::first();
}
}