[TESTS] Add ignore annotations to code paths that serve as hooks in DependencyInjection

This commit is contained in:
Hugo Sales 2021-07-20 14:07:22 +00:00
parent 28c010fcc7
commit bfe9c6c9c4
Signed by: someonewithpc
GPG Key ID: 7D0C7EAFC9D835A0
2 changed files with 11 additions and 3 deletions

View File

@ -39,6 +39,9 @@ use Symfony\Component\DependencyInjection\ContainerBuilder;
class ModuleManagerPass implements CompilerPassInterface class ModuleManagerPass implements CompilerPassInterface
{ {
/**
* @codeCoverageIgnore
*/
public function process(ContainerBuilder $container) public function process(ContainerBuilder $container)
{ {
ModuleManager::process($container); ModuleManager::process($container);

View File

@ -45,6 +45,8 @@ class SchemaDefDriver extends StaticPHPDriver implements CompilerPassInterface
{ {
/** /**
* Register `app.schemadef_driver` (this class instantiated with argument src/Entity) as a metadata driver * Register `app.schemadef_driver` (this class instantiated with argument src/Entity) as a metadata driver
*
* @codeCoverageIgnore
*/ */
public function process(ContainerBuilder $container) public function process(ContainerBuilder $container)
{ {
@ -110,6 +112,8 @@ class SchemaDefDriver extends StaticPHPDriver implements CompilerPassInterface
} }
if (false && $opts['foreign key'] ?? false) { if (false && $opts['foreign key'] ?? false) {
// @codeCoverageIgnoreStart
// TODO: Get foreign keys working
foreach (['target', 'multiplicity'] as $f) { foreach (['target', 'multiplicity'] as $f) {
if (!isset($opts[$f])) { if (!isset($opts[$f])) {
throw new \Exception("{$class_name}.{$name} doesn't have the required field `{$f}`"); throw new \Exception("{$class_name}.{$name} doesn't have the required field `{$f}`");
@ -120,8 +124,8 @@ class SchemaDefDriver extends StaticPHPDriver implements CompilerPassInterface
// TODO still need to map nullability, comment, fk name and such, but // TODO still need to map nullability, comment, fk name and such, but
// the interface doesn't seem to support it currently // the interface doesn't seem to support it currently
list($target_entity, $target_field) = explode('.', $opts['target']); [$target_entity, $target_field] = explode('.', $opts['target']);
$map = [ $map = [
'fieldName' => $name, 'fieldName' => $name,
'targetEntity' => $target_entity, 'targetEntity' => $target_entity,
'joinColumns' => [[ 'joinColumns' => [[
@ -147,8 +151,9 @@ class SchemaDefDriver extends StaticPHPDriver implements CompilerPassInterface
$metadata->mapManyToMany($map); $metadata->mapManyToMany($map);
break; break;
default: default:
throw new \Exception('Invalid multiplicity specified: ' . $opts['multiplicity']); throw new \Exception("Invalid multiplicity specified: '${opts['multiplicity']}' in class: {$class_name}");
} }
// @codeCoverageIgnoreEnd
} else { } else {
// Convert old to new types // Convert old to new types
// For ints, prepend the size (smallint) // For ints, prepend the size (smallint)