From fea191fd2a2a29a897f3e04bf2ce14b97f3af617 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Tue, 8 Nov 2022 17:21:17 +1300 Subject: [PATCH] [NFC] Minor cleanup in test --- tests/phpunit/CRM/Utils/TokenTest.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/phpunit/CRM/Utils/TokenTest.php b/tests/phpunit/CRM/Utils/TokenTest.php index ba14fb9c34..9b620d7c6b 100644 --- a/tests/phpunit/CRM/Utils/TokenTest.php +++ b/tests/phpunit/CRM/Utils/TokenTest.php @@ -1,5 +1,7 @@ assertEquals($tokenString, 'First Name: Morticia Last Name: Addams Birth Date: Prefix: Ms. Suffix: '); + $this->assertEquals('First Name: Morticia Last Name: Addams Birth Date: Prefix: Ms. Suffix: ', $tokenString); // Test compatibility with custom tokens (#14943) $tokenString = 'Custom {custom.custom}'; CRM_Utils_Token::replaceGreetingTokens($tokenString, $contactDetails, $contactId, $className, $escapeSmarty); - $this->assertEquals($tokenString, 'Custom '); + $this->assertEquals('Custom ', $tokenString); } /** @@ -45,9 +47,9 @@ class CRM_Utils_TokenTest extends CiviUnitTestCase { $params['contact_id'] = $this->individualCreate(); // Prepare the processor and general context. - $tokenProc = new \Civi\Token\TokenProcessor(\Civi::dispatcher(), [ + $tokenProc = new TokenProcessor(Civi::dispatcher(), [ // Unique(ish) identifier for our controller/use-case. - 'controller' => 'civicrm_tokentest', + 'controller' => 'civicrm_token_test', // Provide hints about what data will be available for each row. // Ex: 'schema' => ['contactId', 'activityId', 'caseId'], @@ -74,7 +76,6 @@ class CRM_Utils_TokenTest extends CiviUnitTestCase { $this->assertNotEmpty($tokenProc->getRows()); foreach ($tokenProc->getRows() as $tokenRow) { - /** @var \Civi\Token\TokenRow $tokenRow */ $html = $tokenRow->render('body_html'); $text = $tokenRow->render('body_text'); $this->assertEquals($expect[$params['contact_id']]['html'], $html); -- 2.25.1