Documentation

CTest::GetCount

int
CTest::GetCount(
 array arFilter = Array()
);

The GetCount method returns the number of tests satisfying the filter.

Parameters

ParameterDescription
arFilter The array array("filtered field"=>"filter value" [, ...]). Filter description is available in CTest::GetList.
By default, tests are not filtered.

Return Values

The method returns the number of tests.

See Also

  • CTest::GetList
  • Example

    
    <?
    if (CModule::IncludeModule("learning"))
    {
        $COURSE_ID = 97;
        
        $cnt = CTest::GetCount(Array("ACTIVE" => "Y", "COURSE_ID" => $COURSE_ID));
    
        echo "Number of tests: ".$cnt;
    }
    ?>

    
    <?
    if (CModule::IncludeModule("learning"))
    {
        $COURSE_ID = 97;
        
        $cnt = CTest::GetCount(Array("CHECK_PERMISSIONS" => "N", "COURSE_ID" => $COURSE_ID));
    
        echo "Number of tests: ".$cnt;
    }
    ?>
    © «Bitrix24», 2001-2024