Page MenuHomeIn-Portal Phabricator

INP-1429 - Class hierarchy analyzer
ClosedPublic

Authored by alex on May 3 2015, 12:11 PM.

Details

Test Plan

File contents:

<?php

interface BaseInterface {

}

interface SubInterface1 extends BaseInterface {

}

interface SubInterface2 extends BaseInterface {

}

class SubClass1_0 implements BaseInterface
{

}

class SubClass2_0 implements BaseInterface
{

}

class SubClass1_1 implements SubInterface1
{

}

abstract class SubClass2_1 implements SubInterface1
{

}

class SubClass1_2 implements SubInterface2
{

}

class SubClass2_2 implements SubInterface2
{

}
  1. create a PHP file with above content anywhere within module directory space
  2. run the php tools/build_class_map.php to rebuild class map
  3. press the Reset button under the Reset Parsed and Cached System Data section in System Tools section
  4. place $sub_classes = $this->Application->getSubClasses('SubInterface1'); somewhere
  5. confirm, that $sub_classes array contains following classes:
    • SubClass1_1
  6. place $sub_classes = $this->Application->getSubClasses('SubInterface1', false); somewhere
  7. confirm, that $sub_classes array contains following classes:
    • SubClass1_1
    • SubClass2_1
  8. place $sub_classes = $this->Application->getSubClasses('BaseInterface'); somewhere
  9. confirm, that $sub_classes array contains following classes:
    • SubClass1_0
    • SubClass2_0
    • SubClass1_1
    • SubClass1_2
    • SubClass2_2
  10. in test file change interfaces into classes
  11. repeat above testing scenario (interfaces transformed into classes will also be present in results and that's normal)
  12. use the getSubClasses method on a class/interface not under In-Portal (or non-existing class/interface) auto-loader control
  13. confirm, that this will result in exception
  14. register a replacement interface (via RegisterClasses unit config setting in any unit config) for SubInterface2 interface
  15. confirm that $sub_classes = $this->Application->getSubClasses('BaseInterface');:
    • containers replaced interface
    • doesn't contain SubInterface2 interface
    • the sub-classes/sub-interfaces of replaced SubInterface2 are listed in array
    • the sub-classes/sub-interfaces of replacement interface are not listed in array

Diff Detail

Repository
rINP In-Portal
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

alex updated this revision to Diff 170.May 3 2015, 12:11 PM
alex retitled this revision from to INP-1429 - Class hierarchy analyzer.
alex updated this object.
alex edited the test plan for this revision. (Show Details)
alex added 1 JIRA issue(s): INP-1429.
alex edited the test plan for this revision. (Show Details)May 3 2015, 12:14 PM
alex edited edge metadata.
alex edited the test plan for this revision. (Show Details)May 3 2015, 12:19 PM
alex edited the test plan for this revision. (Show Details)May 8 2015, 1:32 AM
glebs accepted this revision.May 8 2015, 2:30 AM
glebs edited edge metadata.
This revision is now accepted and ready to land.May 8 2015, 2:30 AM
alex updated this revision to Diff 173.May 8 2015, 2:49 AM
alex edited edge metadata.

Lift memory/time limits, when parsing PHP files.

This revision now requires review to proceed.May 8 2015, 2:49 AM
glebs accepted this revision.May 8 2015, 2:52 AM
glebs edited edge metadata.
This revision is now accepted and ready to land.May 8 2015, 2:52 AM
This revision was automatically updated to reflect the committed changes.