Unexpected output: Affected paths: relative - resubmit patch.
⚙ D458 INP-1852 - Create the "\kUtil::varDumpColorized" method
Page MenuHomeIn-Portal Phabricator

INP-1852 - Create the "\kUtil::varDumpColorized" method
AcceptedPublic

Authored by alex on Jan 15 2024, 5:47 AM.

Details

Reviewers
erik
Test Plan
NOTE: Run the composer update command after applying a patch to sync contents of the /vendor folder with changes made to the composer.json.
  • in IDE:
    1. replace the $application->Run(); line in the /index.php file with the following content:
$test = array(
    5 => 'value',
    'test' => 12,
);

$result1 = '{{{' . kUtil::varDumpColorized($test + array('result_number' => 1), 'front-end', false) . '}}}';
$result2 = '{{{' . kUtil::varDumpColorized($test + array('result_number' => 2), 'front-end', true) . '}}}';
$result3 = '{{{' . kUtil::varDumpColorized($test + array('result_number' => 3), 'front-end') . '}}}';
$result4 = '{{{' . kUtil::varDumpColorized($test + array('result_number' => 4), 'front-end2') . '}}}';
$result5 = '{{{' . kUtil::varDumpColorized($test + array('result_number' => 5), 'front-end2') . '}}}';

echo '<h1>result 1</h1>' . PHP_EOL . $result1 . PHP_EOL . PHP_EOL;
echo '<h1>result 2</h1>' . PHP_EOL . $result2 . PHP_EOL . PHP_EOL;
echo '<h1>result 3</h1>' . PHP_EOL . $result3 . PHP_EOL . PHP_EOL;
echo '<h1>result 4</h1>' . PHP_EOL . $result4 . PHP_EOL . PHP_EOL;
echo '<h1>result 5</h1>' . PHP_EOL . $result5 . PHP_EOL . PHP_EOL;
    1. replace the $application->EventManager->runScheduledTasks(true); line in the /tools/cron.php file with the same content as shown above
  • on the Front-End:
    1. open the homepage (the /index.php URL)
    2. confirm, that displayed content has the following structure:
      • colored dump, that has the result_number key set to 1
      • the result 1 heading
      • nothing wrapped in the {{{ and }}}
      • the result 2 heading
      • the colored dump, that has the result_number key set to 2, wrapped in the {{{ and }}}
      • the result 3 heading
      • the colored dump, that has the result_number key set to 3, wrapped in the {{{ and }}}
      • the result 4 heading
      • the colored dump, that has the result_number key set to 4, wrapped in the {{{ and }}}
      • the result 5 heading
      • the colored dump, that has the result_number key set to 5, wrapped in the {{{ and }}}
    3. do the View Source of the page
    4. confirm, that the large javascript+css block only appears twice in the following places:
      • before the colored dump, that has the result_number key set to 1
      • before the colored dump, that has the result_number key set to 4
  • in CLI:
    1. run the php tools/cron.php command
    2. confirm, that the output is similar (colors might differ) to the Front-End, but the colored dumps are present in the same places

Diff Detail

Repository
rINP In-Portal
Branch
/in-portal/branches/5.2.x
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 1232
Build 1232: arc lint + arc unit

Event Timeline

alex created this revision.Jan 15 2024, 5:47 AM
alex requested review of this revision.Jan 15 2024, 5:47 AM
alex edited the test plan for this revision. (Show Details)Jan 15 2024, 6:04 AM
alex added a project: Restricted Project.
erik requested changes to this revision.Jan 15 2024, 6:19 AM

Not working as expected in test plan. No result_number key detected.


This revision now requires changes to proceed.Jan 15 2024, 6:19 AM
alex requested review of this revision.Jan 15 2024, 6:27 AM
alex edited the test plan for this revision. (Show Details)
In D458#9287, @erik wrote:

Not working as expected in test plan. No result_number key detected.


Updated test plan to populate result_number key in the given PHP code.

erik accepted this revision.Jan 15 2024, 6:32 AM
This revision is now accepted and ready to land.Jan 15 2024, 6:32 AM