With latest 8.0.x core and 8.x-3.x Rules, I'm getting the following errors:

$ ./vendor/bin/phpunit ../modules/rules
PHPUnit 4.4.2 by Sebastian Bergmann.

Configuration read from /Users/dasjo/am/d8rules/core/phpunit.xml.dist

.
Fatal error: Call to a member function getCanonicalRepresentation() on a non-object in /Users/dasjo/am/d8rules/core/lib/Drupal/Core/Plugin/Context/Context.php on line 49

and

$ php ./core/scripts/run-tests.sh --verbose --color "rules"

Drupal test run
---------------

Tests to be run:
  - Drupal\rules\Tests\ConfigEntityTest
  - Drupal\rules\Tests\DataProcessorTest
  - Drupal\rules\Tests\NodeIntegrationTest
  - Drupal\rules\Tests\RulesEngineTest

Test run started:

Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /Users/dasjo/am/d8rules/core/scripts/run-tests.sh on line 891
  Wednesday, April 15, 2015 - 10:10

Test summary
------------

Drupal\rules\Tests\ConfigEntityTest                           10 passes                                      

Fatal error: Call to a member function getCanonicalRepresentation() on a non-object in /Users/dasjo/am/d8rules/core/lib/Drupal/Core/Plugin/Context/Context.php on line 49
FATAL Drupal\rules\Tests\DataProcessorTest: test runner returned a non-zero error code (255).
- Found database prefix 'simpletest204108' for test ID 6.
[15-Apr-2015 10:10:56 UTC] PHP Fatal error:  Call to a member function getCanonicalRepresentation() on a non-object in /Users/dasjo/am/d8rules/core/lib/Drupal/Core/Plugin/Context/Context.php on line 49

- Removed test site directory.
- Removed 1 leftover tables.

Fatal error: Call to a member function getCanonicalRepresentation() on a non-object in /Users/dasjo/am/d8rules/core/lib/Drupal/Core/Plugin/Context/Context.php on line 49
FATAL Drupal\rules\Tests\NodeIntegrationTest: test runner returned a non-zero error code (255).
- Found database prefix 'simpletest361483' for test ID 7.
[15-Apr-2015 10:10:56 UTC] PHP Fatal error:  Call to a member function getCanonicalRepresentation() on a non-object in /Users/dasjo/am/d8rules/core/lib/Drupal/Core/Plugin/Context/Context.php on line 49

- Removed test site directory.
- Removed 10 leftover tables.

Fatal error: Call to a member function getCanonicalRepresentation() on a non-object in /Users/dasjo/am/d8rules/core/lib/Drupal/Core/Plugin/Context/Context.php on line 49
FATAL Drupal\rules\Tests\RulesEngineTest: test runner returned a non-zero error code (255).
- Found database prefix 'simpletest711227' for test ID 8.
[15-Apr-2015 10:10:57 UTC] PHP Fatal error:  Call to a member function getCanonicalRepresentation() on a non-object in /Users/dasjo/am/d8rules/core/lib/Drupal/Core/Plugin/Context/Context.php on line 49

- Removed test site directory.
- Removed 1 leftover tables.

Test run duration: 4 sec

Detailed test results
---------------------


---- Drupal\rules\Tests\ConfigEntityTest ----


Status    Group      Filename          Line Function                            
--------------------------------------------------------------------------------
Pass      Other      RulesDrupalTestBa   49 Drupal\rules\Tests\RulesDrupalTestB
    Enabled modules: rules, rules_test, system.
Pass      Other      RulesDrupalTestBa   49 Drupal\rules\Tests\RulesDrupalTestB
    Enabled modules: rules, rules_test, system.
Pass      Other      ConfigEntityTest.   67 Drupal\rules\Tests\ConfigEntityTest
    Expression ID was successfully loaded.
Pass      Other      ConfigEntityTest.   68 Drupal\rules\Tests\ConfigEntityTest
    Action configuration is the same after loading the config.
Pass      Other      ConfigEntityTest.   76 Drupal\rules\Tests\ConfigEntityTest
    Value 'action called' is equal to value 'action called'.
Pass      Other      RulesDrupalTestBa   49 Drupal\rules\Tests\RulesDrupalTestB
    Enabled modules: rules, rules_test, system.
Pass      Other      ConfigEntityTest.  103 Drupal\rules\Tests\ConfigEntityTest
    Value 'action called' is equal to value 'action called'.
Pass      Other      RulesDrupalTestBa   49 Drupal\rules\Tests\RulesDrupalTestB
    Enabled modules: rules, rules_test, system.
Pass      Other      ConfigEntityTest.  130 Drupal\rules\Tests\ConfigEntityTest
    Data type of context definition is correct.
Pass      Other      ConfigEntityTest.  131 Drupal\rules\Tests\ConfigEntityTest
    Label of context definition is correct.


---- Drupal\rules\Tests\DataProcessorTest ----


Status    Group      Filename          Line Function                            
--------------------------------------------------------------------------------
Fail      Completion DataProcessorTest   22 Drupal\rules\Tests\DataProcessorTes
    The test did not complete due to a fatal error.
Pass      Other      RulesDrupalTestBa   49 Drupal\rules\Tests\RulesDrupalTestB
    Enabled modules: rules, rules_test, system.
Exception Warning    Context.php         49 Drupal\Core\Plugin\Context\Context-
    Drupal\Core\Plugin\Context\Context::getContextValue(): It is not safe to
    rely on the system's timezone settings. You are *required* to use the
    date.timezone setting or the date_default_timezone_set() function. In case
    you used any of those methods and you are still getting this warning, you
    most likely misspelled the timezone identifier. We selected the timezone
    'UTC' for now, but please set date.timezone to select your
    timezone.Drupal\Core\Plugin\Context\Context->getContextValue()
    Drupal\Component\Plugin\ContextAwarePluginBase->getContextValue('message')
    Drupal\rules\Plugin\RulesExpression\RulesAction->processData(Object)
    Drupal\rules\Plugin\RulesExpression\RulesAction->executeWithState(Object)
    Drupal\rules\Plugin\RulesExpression\ActionSet->executeWithState(Object)
    Drupal\rules\Plugin\RulesExpression\Rule->executeWithState(Object)
    Drupal\rules\Plugin\RulesExpression\Rule->execute()
    Drupal\rules\Tests\DataProcessorTest->testNumericOffset()
    Drupal\simpletest\TestBase->run(Array)
    simpletest_script_run_one_test('6', 'Drupal\rules\Tests\DataProcessorTest')
Fail      PHP Fatal  Context.php         49 Unknown                            
    Call to a member function getCanonicalRepresentation() on a non-object


---- Drupal\rules\Tests\NodeIntegrationTest ----


Status    Group      Filename          Line Function                            
--------------------------------------------------------------------------------
Fail      Completion NodeIntegrationTe   46 Drupal\rules\Tests\NodeIntegrationT
    The test did not complete due to a fatal error.
Pass      Other      RulesDrupalTestBa   49 Drupal\rules\Tests\RulesDrupalTestB
    Enabled modules: rules, rules_test, system, node, field, text, entity, user.
Pass      Other      NodeIntegrationTe   38 Drupal\rules\Tests\NodeIntegrationT
    Installed system tables: {sequences}.
Pass      Other      NodeIntegrationTe   39 Drupal\rules\Tests\NodeIntegrationT
    Installed entity type tables for the user entity type: {users},
    {users_field_data}
Pass      Other      NodeIntegrationTe   40 Drupal\rules\Tests\NodeIntegrationT
    Installed entity type tables for the node entity type: {node},
    {node_field_data}, {node_revision}, {node_field_revision}
Exception Warning    Context.php         49 Drupal\Core\Plugin\Context\Context-
    Drupal\Core\Plugin\Context\Context::getContextValue(): It is not safe to
    rely on the system's timezone settings. You are *required* to use the
    date.timezone setting or the date_default_timezone_set() function. In case
    you used any of those methods and you are still getting this warning, you
    most likely misspelled the timezone identifier. We selected the timezone
    'UTC' for now, but please set date.timezone to select your
    timezone.Drupal\Core\Plugin\Context\Context->getContextValue()
    Drupal\Component\Plugin\ContextAwarePluginBase->getContextValue('text')
    Drupal\rules_test\Plugin\Condition\TestTextCondition->evaluate()
    Drupal\rules\Plugin\RulesExpression\RulesCondition->executeWithState(Object)
    Drupal\rules\Plugin\RulesExpression\RulesAnd->executeWithState(Object)
    Drupal\rules\Plugin\RulesExpression\Rule->executeWithState(Object)
    Drupal\rules\Plugin\RulesExpression\Rule->execute()
    Drupal\rules\Tests\NodeIntegrationTest->testNodeDataSelector()
    Drupal\simpletest\TestBase->run(Array)
    simpletest_script_run_one_test('7',
    'Drupal\rules\Tests\NodeIntegrationTest')
Fail      PHP Fatal  Context.php         49 Unknown                            
    Call to a member function getCanonicalRepresentation() on a non-object


---- Drupal\rules\Tests\RulesEngineTest ----


Status    Group      Filename          Line Function                            
--------------------------------------------------------------------------------
Pass      Other      RulesDrupalTestBa   49 Drupal\rules\Tests\RulesDrupalTestB
    Enabled modules: rules, rules_test, system.
Pass      Other      RulesEngineTest.p   44 Drupal\rules\Tests\RulesEngineTest-
    Value true is TRUE.
Pass      Other      RulesEngineTest.p   54 Drupal\rules\Tests\RulesEngineTest-
    Value true is TRUE.
Pass      Other      RulesEngineTest.p   64 Drupal\rules\Tests\RulesEngineTest-
    Value true is TRUE.
Pass      Other      RulesEngineTest.p   72 Drupal\rules\Tests\RulesEngineTest-
    Value 'action called' is equal to value 'action called'.
Fail      Completion RulesEngineTest.p   78 Drupal\rules\Tests\RulesEngineTest-
    The test did not complete due to a fatal error.
Pass      Other      RulesDrupalTestBa   49 Drupal\rules\Tests\RulesDrupalTestB
    Enabled modules: rules, rules_test, system.
Exception Warning    Context.php         49 Drupal\Core\Plugin\Context\Context-
    Drupal\Core\Plugin\Context\Context::getContextValue(): It is not safe to
    rely on the system's timezone settings. You are *required* to use the
    date.timezone setting or the date_default_timezone_set() function. In case
    you used any of those methods and you are still getting this warning, you
    most likely misspelled the timezone identifier. We selected the timezone
    'UTC' for now, but please set date.timezone to select your
    timezone.Drupal\Core\Plugin\Context\Context->getContextValue()
    Drupal\Component\Plugin\ContextAwarePluginBase->getContextValue('text')
    Drupal\rules_test\Plugin\Condition\TestTextCondition->evaluate()
    Drupal\rules\Plugin\RulesExpression\RulesCondition->executeWithState(Object)
    Drupal\rules\Plugin\RulesExpression\RulesAnd->executeWithState(Object)
    Drupal\rules\Plugin\RulesExpression\Rule->executeWithState(Object)
    Drupal\rules\Plugin\RulesExpression\Rule->execute()
    Drupal\rules\Tests\RulesEngineTest->testContextPassing()
    Drupal\simpletest\TestBase->run(Array)
    simpletest_script_run_one_test('8', 'Drupal\rules\Tests\RulesEngineTest')
Fail      PHP Fatal  Context.php         49 Unknown                            
    Call to a member function getCanonicalRepresentation() on a non-object
CommentFileSizeAuthor
#2 undefined_TypedDataManager-2471531-1.patch528 bytespjezek
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

pjezek’s picture

Assigned: Unassigned » pjezek

looking into it as I like to execute this tests.

pjezek’s picture

I found the issue in core and fixed it. See attached patch file.

pjezek’s picture

Status: Active » Needs review
pjezek’s picture

Assigned: pjezek » Unassigned
klausi’s picture

Status: Needs review » Closed (duplicate)

Duplicate of #2467411: Context class does not use typed data trait correctly, leading to fatal errors. Could you review that patch and post your feedback?

pjezek’s picture

@klausi: thx ;)