From b464a4ba3a0187cc1128244000ffbcb69e6b57d4 Mon Sep 17 00:00:00 2001 From: Ryan McCue Date: Wed, 24 Feb 2016 08:28:12 +0000 Subject: [PATCH] REST API: Fix error in Request tests. On the 21st of November, 2014, I committed tests for WP_REST_Request to the API plugin. Although I didn't realise at the time, I was causing my future self to go through hours of sufferring. Unfortunately, I forgot to call parent::setUp() which would break the tests in subtle ways in the future and would ruin the good part of my day. Let this be a warning to all of you who write future unit tests. See https://github.com/WP-API/WP-API/commit/f0396be17e1dd312065a2382e4e8a1361c1eb634 for the original commit. git-svn-id: https://develop.svn.wordpress.org/trunk@36678 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/rest-api/rest-request.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/phpunit/tests/rest-api/rest-request.php b/tests/phpunit/tests/rest-api/rest-request.php index e3b8eea2e3..bd6548341e 100644 --- a/tests/phpunit/tests/rest-api/rest-request.php +++ b/tests/phpunit/tests/rest-api/rest-request.php @@ -11,6 +11,8 @@ */ class Tests_REST_Request extends WP_UnitTestCase { public function setUp() { + parent::setUp(); + $this->request = new WP_REST_Request(); }