You are here

protected function PropertiesBaseTestCase::createProperties in Dynamic properties 7

Creates a given number of categories including attributes.

Parameters

$maxi: Number of categories to create.

4 calls to PropertiesBaseTestCase::createProperties()
PropertiesCompareTestCase::testPropertyFieldCreation in properties_compare/properties_compare.test
Test comparing to similiar nodes.
PropertiesTemplateTestCase::testExportAsTemplate in properties_template/properties_template.test
Test for exporting a content as template.
PropertiesTemplateTestCase::testPropertyFieldCreation in properties_template/properties_template.test
Create a content based on a template.
PropertiesTestCase::testPropertyFieldCreation in ./properties.test
Test field creation functionality.

File

./properties.test, line 145
Contains tests for the properties.module

Class

PropertiesBaseTestCase
Base class for properties tests, provides helper methods.

Code

protected function createProperties($maxi = 3, $maxj = 3) {

  // Create attributes.
  $this->categories = array();
  for ($i = 0; $i < $maxi; $i++) {
    for ($j = 0; $j < $maxj; $j++) {
      $this->attributes[$i][$j] = $this
        ->createAttribute();
    }
    $this->categories[$i] = $this
      ->createCategory(NULL, NULL, $this->attributes[$i]);
  }
}