Hi,

I have run into a problem that I can't figure out how to fix. I was
using the validation framework to test that certain values were being
correctly flagged as invalid, and it was working fine in PR9, but
after updating to PR10, I'm getting errors.

Here's a small test that can recreate my problem:

namespace Test;

use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;

class Object {

  /**
   * @validation:NotNull()
   */
  public $name;
}

class ValidationTest extends WebTestCase {

  protected $kernel;
  protected $validator;

  protected function setUp() {
    parent::setUp();

    $this->kernel = $this->createKernel();
    $this->kernel->boot();

    $this->validator = $this->kernel->getContainer()-
>get('validator');
  }

  public function testNameCannotBeNull() {
    $violations = $this->validator->validatePropertyValue('Test
\Object', 'name', null);
    self::assertGreaterThan(0, count($violations));
  }
}

This test passes fine in PR9, but fails in PR10. If ran in PR10, I get
the following exception:

1) Test\ValidationTest::testNameCannotBeNull
Undefined index: name

/Users/dtyler/Projects/quartz/vendor/symfony/src/Symfony/Component/
Validator/Mapping/ClassMetadata.php:230
/Users/dtyler/Projects/quartz/vendor/symfony/src/Symfony/Component/
Validator/GraphWalker.php:118
/Users/dtyler/Projects/quartz/vendor/symfony/src/Symfony/Component/
Validator/Validator.php:77
/Users/dtyler/Projects/quartz/vendor/symfony/src/Symfony/Component/
Validator/Validator.php:101
/Users/dtyler/Projects/quartz/vendor/symfony/src/Symfony/Component/
Validator/Validator.php:80
/Users/dtyler/Projects/quartz/src/Acme/DemoBundle/Tests/Entity/
ValidationTest.php:30

I've looked through the commits since PR9 and can see various changes
to the Validation component, but I'm not super familiar with it so I'm
getting a little lost. All I can tell is that ClassMetadata doesn't
have any members listed for the class I'm testing.

Does anyone know what has changed to cause this and how I fix it?

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to