From 47d144d511f8cc0c045fa8bebf6fbadc040d84de Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Mon, 18 Sep 2017 17:32:35 +0200 Subject: Tests: Use is instead of ok for improved debug output Signed-off-by: Florian Pritz --- application/test/tests/api_v2/test_file_upload.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'application/test') diff --git a/application/test/tests/api_v2/test_file_upload.php b/application/test/tests/api_v2/test_file_upload.php index cb2f81b74..e8717b074 100644 --- a/application/test/tests/api_v2/test_file_upload.php +++ b/application/test/tests/api_v2/test_file_upload.php @@ -50,8 +50,8 @@ class test_file_upload extends common { $data[] = $this->SendHTTPRequest("GET", $url, ''); } $this->t->ok($data[0] !== $data[1], 'Returned file contents should differ'); - $this->t->ok($data[0] === file_get_contents("data/tests/message1.bin"), "Returned correct data for file 1"); - $this->t->ok($data[1] === file_get_contents("data/tests/message2.bin"), "Returned correct data for file 2"); + $this->t->is($data[0], file_get_contents("data/tests/message1.bin"), "Returned correct data for file 1"); + $this->t->is($data[1], file_get_contents("data/tests/message2.bin"), "Returned correct data for file 2"); } public function test_upload_uploadNothing() -- cgit v1.2.3-24-g4f1b From 1ee7c987f2a0da0678ca5c8c55af7d6138d34872 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Wed, 20 Sep 2017 17:43:56 +0200 Subject: Fix mutlipaste_queue test using incorrect data in mock The error return changed with CI3 so the test also needs to change Signed-off-by: Florian Pritz --- application/test/tests/test_service_multipaste_queue.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'application/test') diff --git a/application/test/tests/test_service_multipaste_queue.php b/application/test/tests/test_service_multipaste_queue.php index 0427425a0..cab53e335 100644 --- a/application/test/tests/test_service_multipaste_queue.php +++ b/application/test/tests/test_service_multipaste_queue.php @@ -38,7 +38,7 @@ class test_service_multipaste_queue extends \test\Test { public function test_get() { - $this->session->shouldReceive('userdata')->with("multipaste_queue")->once()->andReturn(false); + $this->session->shouldReceive('userdata')->with("multipaste_queue")->once()->andReturn(null); $this->t->is_deeply($this->m->get(), [], "Fresh queue is empty"); } @@ -54,7 +54,7 @@ class test_service_multipaste_queue extends \test\Test { public function test_append() { - $this->session->shouldReceive('userdata')->with("multipaste_queue")->once()->andReturn(false); + $this->session->shouldReceive('userdata')->with("multipaste_queue")->once()->andReturn(null); $this->mfile->shouldReceive('valid_id')->with('abc')->times(2)->andReturn(true); $this->session->shouldReceive('set_userdata')->with("multipaste_queue", ['abc'])->once(); $this->t->is($this->m->append(['abc']), null, "append([abc]) should succeed"); -- cgit v1.2.3-24-g4f1b