From 3ad95e46c0a8a506ea46590161b17cb55834c6fa Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 8 Mar 2018 22:40:42 +0100 Subject: [PATCH] Fix phpunit --- htdocs/install/mysql/tables/llx_oauth_token.sql | 2 +- test/phpunit/CodingSqlTest.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/install/mysql/tables/llx_oauth_token.sql b/htdocs/install/mysql/tables/llx_oauth_token.sql index 5c7d6d62177..81ae99c6ce6 100644 --- a/htdocs/install/mysql/tables/llx_oauth_token.sql +++ b/htdocs/install/mysql/tables/llx_oauth_token.sql @@ -19,7 +19,7 @@ CREATE TABLE llx_oauth_token ( rowid integer AUTO_INCREMENT PRIMARY KEY, service varchar(36), token text, -- token in serialize() format, of an object StdOAuth2Token of library phpoauth2 - tokenstring text, -- token in json format '{ "access_token": "sk_test_cccc", "refresh_token": "rt_aaa", "token_type": "bearer", ..., "scope": "read_write" } + tokenstring text, -- token in json format '{"access_token": "sk_test_cccc", "refresh_token": "rt_aaa", "token_type": "bearer", ..., "scope": "read_write"} fk_user integer, fk_adherent integer, entity integer DEFAULT 1 diff --git a/test/phpunit/CodingSqlTest.php b/test/phpunit/CodingSqlTest.php index 0b29b29240d..57be8fc62a9 100644 --- a/test/phpunit/CodingSqlTest.php +++ b/test/phpunit/CodingSqlTest.php @@ -163,10 +163,10 @@ class CodingSqlTest extends PHPUnit_Framework_TestCase $result=strpos($filecontent,'"'); if ($result) { - $result=! strpos($filecontent,'["'); + $result=(! strpos($filecontent,'["') && ! strpos($filecontent,'{"')); } print __METHOD__." Result for checking we don't have double quote = ".$result."\n"; - $this->assertTrue($result===false, 'Found double quote that is not [" (used for json content) into '.$file.'. Bad.'); + $this->assertTrue($result===false, 'Found double quote that is not [" neither {" (used for json content) into '.$file.'. Bad.'); $result=strpos($filecontent,'int('); print __METHOD__." Result for checking we don't have 'int(' instead of 'integer' = ".$result."\n";