Node tests have exceptions
| Project: | Drupal |
| Version: | 7.x-dev |
| Component: | tests |
| Category: | bug report |
| Priority: | critical |
| Assigned: | boombatower |
| Status: | closed |
Unexpected PHP error [Undefined property: stdClass::$vid] severity [E_NOTICE] in [/Applications/MAMP/htdocs/head/modules/node/node.module line 889] [PHP] Exception
Unexpected PHP error [Undefined property: stdClass::$vid] severity [E_NOTICE] in [/Applications/MAMP/htdocs/head/modules/node/node.module line 889] [PHP] Exception
Unexpected PHP error [Undefined property: stdClass::$vid] severity [E_NOTICE] in [/Applications/MAMP/htdocs/head/modules/node/node.module line 889] [PHP] Exception
Unexpected PHP error [Undefined property: stdClass::$vid] severity [E_NOTICE] in [/Applications/MAMP/htdocs/head/modules/node/node.module line 889] [PHP] Exception
Unexpected PHP error [Undefined property: stdClass::$vid] severity [E_NOTICE] in [/Applications/MAMP/htdocs/head/modules/node/node.module line 889] [PHP] Exception
Unexpected PHP error [Undefined property: stdClass::$vid] severity [E_NOTICE] in [/Applications/MAMP/htdocs/head/modules/node/node.module line 889] [PHP] Exception
Unexpected PHP error [Undefined property: stdClass::$vid] severity [E_NOTICE] in [/Applications/MAMP/htdocs/head/modules/node/node.module line 889] [PHP] Exception
Unexpected PHP error [Undefined property: stdClass::$vid] severity [E_NOTICE] in [/Applications/MAMP/htdocs/head/modules/node/node.module line 889] [PHP] Exception

#1
yes, I see this too - using the patched CLI script from: http://drupal.org/node/254166
$ php scripts/run-functional-tests.sh --url http://127.0.0.1/drupal-7 Node
Tests to be run:
- Node revisions
- Node teaser
- Page edit test
- Page preview test
- Page node creation
- Unauthorized node view
Drupal Unit Tests
E_NOTICE: Undefined property: stdClass::$vid in /Users/Shared/www/drupal-7/modules/node/node.module on line 889
E_NOTICE: Undefined property: stdClass::$vid in /Users/Shared/www/drupal-7/modules/node/node.module on line 889
Exception 1!
Unexpected PHP error [Undefined property: stdClass::$vid] severity [E_NOTICE] in [/Users/Shared/www/drupal-7/modules/node/node.module line 889]
in testNodeRevisions
in Node revisions
in Node
Exception 2!
Unexpected PHP error [Undefined property: stdClass::$vid] severity [E_NOTICE] in [/Users/Shared/www/drupal-7/modules/node/node.module line 889]
in testNodeRevisions
in Node revisions
in Node
E_NOTICE: Undefined property: stdClass::$vid in /Users/Shared/www/drupal-7/modules/node/node.module on line 889
E_NOTICE: Undefined property: stdClass::$vid in /Users/Shared/www/drupal-7/modules/node/node.module on line 889
Exception 3!
Unexpected PHP error [Undefined property: stdClass::$vid] severity [E_NOTICE] in [/Users/Shared/www/drupal-7/modules/node/node.module line 889]
in testLogMessage
in Node revisions
in Node
Exception 4!
Unexpected PHP error [Undefined property: stdClass::$vid] severity [E_NOTICE] in [/Users/Shared/www/drupal-7/modules/node/node.module line 889]
in testLogMessage
in Node revisions
in Node
E_NOTICE: Undefined property: stdClass::$vid in /Users/Shared/www/drupal-7/modules/node/node.module on line 889
E_NOTICE: Undefined property: stdClass::$vid in /Users/Shared/www/drupal-7/modules/node/node.module on line 889
Exception 5!
Unexpected PHP error [Undefined property: stdClass::$vid] severity [E_NOTICE] in [/Users/Shared/www/drupal-7/modules/node/node.module line 889]
in testRevisionRevert
in Node revisions
in Node
Exception 6!
Unexpected PHP error [Undefined property: stdClass::$vid] severity [E_NOTICE] in [/Users/Shared/www/drupal-7/modules/node/node.module line 889]
in testRevisionRevert
in Node revisions
in Node
E_NOTICE: Undefined property: stdClass::$vid in /Users/Shared/www/drupal-7/modules/node/node.module on line 889
E_NOTICE: Undefined property: stdClass::$vid in /Users/Shared/www/drupal-7/modules/node/node.module on line 889
Exception 7!
Unexpected PHP error [Undefined property: stdClass::$vid] severity [E_NOTICE] in [/Users/Shared/www/drupal-7/modules/node/node.module line 889]
in testRevisionDelete
in Node revisions
in Node
Exception 8!
Unexpected PHP error [Undefined property: stdClass::$vid] severity [E_NOTICE] in [/Users/Shared/www/drupal-7/modules/node/node.module line 889]
in testRevisionDelete
in Node revisions
in Node
FAILURES!!!
Test cases run: 6/6, Passes: 245, Failures: 0, Exceptions: 8
#2
Just affriming that this is still the case.
#3
Still an issue.
#4
Just a thought, but it would seem like
<?phpif (empty($node->nid)) {
?>
should be
<?phpif (isset($node->nid)) {
?>
Maybe not that simple?
#5
Nah, empty() does an isset() and != 0 check, afair.
I think the answer might actually be getting node.module to initialize these properties when it creates a node object. A bunch of if (!isset($property)) set $property type of logic in every single place that does something similar to the test sounds like a silly thing to do.
That said, though, I didn't get a chance to take a closer look at this yet.
#6
Sorry thought that was the line, but node.module was updated and the above stack trace is out of data, make sure you run the tests on your own machine. The code causing notice is:
<?phpelseif (!empty($node->revision)) {
$node->old_vid = $node->vid;
}
?>
I agree with webchick, if possible they should be initialized, but I never get these warning when creating nodes through interface?? So is this something related to test environment or the error reporting outside of SimpleTest. I checked in common.inc and it is set to E_ALL as expected, but not sure if there are other conditions.
#7
This was an issue with the test itself not passing full node objects to the node API.
I have re-written the test to fit a more standard approach, use less database activity, and check operations more thoroughly.
I have run the complete node test suite and it now passes with NO EXCEPTIONS!
#8
Tested, reviewed and committed. Thanks.
#9
Automatically closed -- issue fixed for two weeks with no activity.