From 7e35def4c3556a2fce62f45e7cd05b2cb7b27cfe Mon Sep 17 00:00:00 2001 From: Kevin Frantz Date: Sun, 4 Nov 2018 14:36:10 +0100 Subject: [PATCH] Implemented tests to keep code coverage high --- .../tests/Unit/Form/NameSourceTypeTest.php | 41 ++++++++++++++++++ .../tests/Unit/Form/UserSourceTypeTest.php | 41 ++++++++++++++++++ application/tests/Unit/Form/UserTypeTest.php | 43 +++++++++++++++++++ 3 files changed, 125 insertions(+) create mode 100644 application/tests/Unit/Form/NameSourceTypeTest.php create mode 100644 application/tests/Unit/Form/UserSourceTypeTest.php create mode 100644 application/tests/Unit/Form/UserTypeTest.php diff --git a/application/tests/Unit/Form/NameSourceTypeTest.php b/application/tests/Unit/Form/NameSourceTypeTest.php new file mode 100644 index 0000000..2883f97 --- /dev/null +++ b/application/tests/Unit/Form/NameSourceTypeTest.php @@ -0,0 +1,41 @@ +type = new NameSourceType(); + } + + public function testBuildForm(): void + { + $builder = $this->createMock(FormBuilderInterface::class); + $this->assertNull($this->type->buildForm($builder, [])); + } + + public function testConfigureOptions(): void + { + $resolver = $this->createMock(OptionsResolver::class); + $this->assertNull($this->type->configureOptions($resolver)); + } +} diff --git a/application/tests/Unit/Form/UserSourceTypeTest.php b/application/tests/Unit/Form/UserSourceTypeTest.php new file mode 100644 index 0000000..13facc7 --- /dev/null +++ b/application/tests/Unit/Form/UserSourceTypeTest.php @@ -0,0 +1,41 @@ +type = new UserSourceType(); + } + + public function testBuildForm(): void + { + $builder = $this->createMock(FormBuilderInterface::class); + $this->assertNull($this->type->buildForm($builder, [])); + } + + public function testConfigureOptions(): void + { + $resolver = $this->createMock(OptionsResolver::class); + $this->assertNull($this->type->configureOptions($resolver)); + } +} diff --git a/application/tests/Unit/Form/UserTypeTest.php b/application/tests/Unit/Form/UserTypeTest.php new file mode 100644 index 0000000..6c3650f --- /dev/null +++ b/application/tests/Unit/Form/UserTypeTest.php @@ -0,0 +1,43 @@ +type = new UserType(); + } + + public function testBuildForm(): void + { + $builder = new FormBuilder(null, null, $this->createMock(EventDispatcherInterface::class), $this->createMock(FormFactoryInterface::class)); + $this->assertNull($this->type->buildForm($builder, [])); + } + + public function testConfigureOptions(): void + { + $resolver = $this->createMock(OptionsResolver::class); + $this->assertNull($this->type->configureOptions($resolver)); + } +}