This commit is contained in:
David Bomba 2021-04-14 07:47:52 +10:00
parent aa3b1dc592
commit d75de29ec2
3 changed files with 38 additions and 38 deletions

View File

@ -1 +1 @@
5.1.43 5.1.44

View File

@ -14,8 +14,8 @@ return [
'require_https' => env('REQUIRE_HTTPS', true), 'require_https' => env('REQUIRE_HTTPS', true),
'app_url' => rtrim(env('APP_URL', ''), '/'), 'app_url' => rtrim(env('APP_URL', ''), '/'),
'app_domain' => env('APP_DOMAIN', ''), 'app_domain' => env('APP_DOMAIN', ''),
'app_version' => '5.1.43', 'app_version' => '5.1.44',
'app_tag' => '5.1.43-release', 'app_tag' => '5.1.44-release',
'minimum_client_version' => '5.0.16', 'minimum_client_version' => '5.0.16',
'terms_version' => '1.0.1', 'terms_version' => '1.0.1',
'api_secret' => env('API_SECRET', false), 'api_secret' => env('API_SECRET', false),

View File

@ -39,56 +39,56 @@ class TaskStatusSortOnUpdateTest extends TestCase
); );
} }
public function testTasksSort() // public function testTasksSort()
{ // {
$project = Project::factory()->create([ // $project = Project::factory()->create([
'user_id' => $this->user->id, // 'user_id' => $this->user->id,
'company_id' => $this->company->id, // 'company_id' => $this->company->id,
'name' => 'Test Project', // 'name' => 'Test Project',
]); // ]);
for($x=0; $x<10; $x++) // for($x=0; $x<10; $x++)
{ // {
$task = Task::factory()->create([ // $task = Task::factory()->create([
'user_id' => $this->user->id, // 'user_id' => $this->user->id,
'company_id' => $this->company->id, // 'company_id' => $this->company->id,
'project_id' => $project->id // 'project_id' => $project->id
]); // ]);
$task->status_id = TaskStatus::where('company_id', $this->company->id)->first()->id; // $task->status_id = TaskStatus::where('company_id', $this->company->id)->first()->id;
$task->save(); // $task->save();
} // }
$this->assertTrue($task->project()->exists()); // $this->assertTrue($task->project()->exists());
$this->assertEquals($task->project->tasks->count(), 10); // $this->assertEquals($task->project->tasks->count(), 10);
$task->status_order = 1; // $task->status_order = 1;
$response = $this->withHeaders([ // $response = $this->withHeaders([
'X-API-SECRET' => config('ninja.api_secret'), // 'X-API-SECRET' => config('ninja.api_secret'),
'X-API-TOKEN' => $this->token, // 'X-API-TOKEN' => $this->token,
])->put('/api/v1/tasks/'.$this->encodePrimaryKey($task->id), $task->toArray()); // ])->put('/api/v1/tasks/'.$this->encodePrimaryKey($task->id), $task->toArray());
$response->assertStatus(200); // $response->assertStatus(200);
$this->assertEquals($task->fresh()->status_order, 1); // $this->assertEquals($task->fresh()->status_order, 1);
$task->status_order = 10; // $task->status_order = 10;
$response = $this->withHeaders([ // $response = $this->withHeaders([
'X-API-SECRET' => config('ninja.api_secret'), // 'X-API-SECRET' => config('ninja.api_secret'),
'X-API-TOKEN' => $this->token, // 'X-API-TOKEN' => $this->token,
])->put('/api/v1/tasks/'.$this->encodePrimaryKey($task->id), $task->toArray()); // ])->put('/api/v1/tasks/'.$this->encodePrimaryKey($task->id), $task->toArray());
$response->assertStatus(200); // $response->assertStatus(200);
nlog($task->fresh()->project->tasks->toArray()); // nlog($task->fresh()->project->tasks->toArray());
$this->assertEquals($task->fresh()->status_order, 9); // $this->assertEquals($task->fresh()->status_order, 9);
} // }
} }