public function testApplyLocationOptionalWithEmptyAttribute() { $request = new Request([], [], [self::PROPERTY_NAME => null]); $config = $this->createConfiguration(self::LOCATION_CLASS, 'location'); $config->expects($this->once())->method('isOptional')->will($this->returnValue(true)); $this->assertFalse($this->converter->apply($request, $config)); $this->assertNull($request->attributes->get('location')); }