Closed bugfolder closed 2 years ago
@bugfolder I'm unable to replicate this issue. See attached image. I followed your directions and added your debug line within entity_plus.test
, inside testEntityQuery
.
Are you working with the latest dev version of Entity Plus? We have been making several changes that have not been released yet.
Can you tell me to which specific test function you added your line?
Thanks for the quick response! Hmm, I just downloaded the latest dev release, trying it, and am still seeing it.
So maybe it's something peculiar to Rules's testing setup (I've only been trying it in various Rules tests).
I can probably take a closer look in a couple of hours. Can you give me more details as to which test method and from which module? (Rules I assume)
So I just tried what you described doing, and it behaved (with both 1.0.13 and the dev version of Entity Plus). So, yeah, sorry, it must be some interaction with what Rules is doing to set up for testing.
I found that if I put that debug() call even in the setUp method of any of several different Rules tests (but after calling the parent::setUp()
) it lost the bundles tag.
With that added information, I"ll investigate further. Thank you for offering, but I don't want to make unnecessary work for you. If/when I figure out what's going on, I'll post here as a resolution.
Well, that was (is) weird. It appears that I need to explicitly include entity_plus
and locale
in the setup call (like this):
parent::setUp('entity_plus', 'locale', 'rules', 'rules_test', 'path');
and then that not only addresses the issue with entity_plus_get_property_info()
, it fixes the particular tests that were failing due to the discrepancy. So, progress!
I'll close this issue, since it seems like the problem was a Rules thing, not an Entity Plus thing. Thanks for quick jump-in!
This arose when I was investigating why many of the ported tests in Rules module were failing. Eventually, I narrowed the issue down to this peculiar behavior.
In a standard Backdrop installation, which creates the
page
andpost
types, the functionentity_plus_get_property_info('node')
will return an array with two keys,array( 'bundles' => ..., 'properties' => ...)
.In a Simpletest test run, the same two node types are created (along with the usual node 1). However, any call to
entity_plus_get_property_info('node')
returns an array missing thebundles
key. This causes lots of problems downstream in the Rules tests, so that Rules things that fail in the tests work perfectly well in the UI.To verify this, turn on Devel, go to admin/devel/php, and enter this code:
You'll see the resulting array with two keys.
Now go into any test that uses the "standard" profile and add this line (which just prints the keys, for brevity):
debug(print_r(array_keys(entity_plus_get_property_info('node')), TRUE));
Run the test. You will see in the output:
So no
'bundles'
key.Any ideas on why the discrepancy is there, and how to fix it?