summaryrefslogtreecommitdiffstats
path: root/core/modules/breakpoint/src/Tests/BreakpointGroupAPITest.php
diff options
context:
space:
mode:
Diffstat (limited to 'core/modules/breakpoint/src/Tests/BreakpointGroupAPITest.php')
-rw-r--r--core/modules/breakpoint/src/Tests/BreakpointGroupAPITest.php75
1 files changed, 0 insertions, 75 deletions
diff --git a/core/modules/breakpoint/src/Tests/BreakpointGroupAPITest.php b/core/modules/breakpoint/src/Tests/BreakpointGroupAPITest.php
deleted file mode 100644
index f8a0191..0000000
--- a/core/modules/breakpoint/src/Tests/BreakpointGroupAPITest.php
+++ /dev/null
@@ -1,75 +0,0 @@
-<?php
-/**
- * @file
- * Definition of Drupal\breakpoint\Tests\BreakpointGroupAPITest.
- */
-
-namespace Drupal\breakpoint\Tests;
-
-use Drupal\breakpoint\Tests\BreakpointsTestBase;
-use Drupal\breakpoint\Entity\BreakpointGroup;
-use Drupal\breakpoint\Entity\Breakpoint;
-use Drupal\breakpoint\InvalidBreakpointNameException;
-use Drupal\breakpoint\InvalidBreakpointSourceException;
-use Drupal\breakpoint\InvalidBreakpointSourceTypeException;
-use Drupal\Component\Utility\Unicode;
-
-/**
- * Tests general API functions of the breakpoint module.
- *
- * @group breakpoint
- */
-class BreakpointGroupAPITest extends BreakpointGroupTestBase {
-
- /**
- * Test Breakpoint::buildConfigName().
- */
- public function testConfigName() {
- // Try an invalid sourceType.
- $label = $this->randomMachineName();
- $breakpoint_group = entity_create('breakpoint_group', array(
- 'label' => $label,
- 'name' => drupal_strtolower($label),
- 'source' => 'custom_module',
- 'sourceType' => 'oops',
- ));
-
- $exception = FALSE;
- try {
- $breakpoint_group->save();
- }
- catch (InvalidBreakpointSourceTypeException $e) {
- $exception = TRUE;
- }
- $this->assertTrue($exception, 'An exception is thrown when an invalid sourceType is entered.');
-
- // Try an invalid source.
- $breakpoint_group = $breakpoint_group->createDuplicate();
- $breakpoint_group->name = '';
- $breakpoint_group->sourceType = Breakpoint::SOURCE_TYPE_USER_DEFINED;
- $breakpoint_group->source = 'custom*_module source';
-
- $exception = FALSE;
- try {
- $breakpoint_group->save();
- }
- catch (InvalidBreakpointSourceException $e) {
- $exception = TRUE;
- }
- $this->assertTrue($exception, 'An exception is thrown when an invalid source is entered.');
-
- // Try a valid breakpoint_group.
- $breakpoint_group = $breakpoint_group->createDuplicate();
- $breakpoint_group->name = 'test';
- $breakpoint_group->source = 'custom_module_source';
-
- $exception = FALSE;
- try {
- $breakpoint_group->save();
- }
- catch (\Exception $e) {
- $exception = TRUE;
- }
- $this->assertFalse($exception, 'No exception is thrown when a valid data is passed.');
- }
-}