Skip to content

Commit

Permalink
fixed unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pookmish committed Oct 3, 2023
1 parent e219c38 commit 3ae5ffb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ third_party_settings:
classes: ''
show_empty_fields: false
id: ''
direction: vertical
direction: horizontal
width_breakpoint: 640
group_site_details:
children:
Expand Down
2 changes: 1 addition & 1 deletion src/EventSubscriber/EventSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ public function onEntityInsert(EntityInsertEvent $event) {
public function onEntityPreSave(EntityPresaveEvent $event) {
$entity = $event->getEntity();
if (
!getenv('CI') &&
$entity->getEntityTypeId() == 'config_pages' &&
$entity->bundle() == 'stanford_basic_site_settings'
) {
Expand All @@ -117,6 +116,7 @@ public function onKernelRequest(RequestEvent $event) {
$current_uri = $event->getRequest()->getRequestUri();

if (
!getenv('CI') &&
$current_uri != '/admin/config/system/basic-site-settings' &&
self::redirectUser()
) {
Expand Down
7 changes: 2 additions & 5 deletions tests/src/Kernel/EventSubscriber/EventSubscriberTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use Drupal\media\Entity\Media;
use Drupal\media\Entity\MediaType;
use Drupal\stanford_profile\EventSubscriber\EventSubscriber as StanfordEventSubscriber;
use function Symfony\Component\DependencyInjection\Loader\Configurator\service;

/**
* Class EventSubscriberTest.
Expand Down Expand Up @@ -60,11 +61,7 @@ public function setup(): void {
$this->installEntitySchema('oauth2_token');
$this->installEntitySchema('media');


$file_system = $this->createMock(FileSystemInterface::class);
$logger_factory = $this->createMock(LoggerChannelFactoryInterface::class);

$this->eventSubscriber = new TestStanfordEventSubscriber($file_system, $logger_factory);
$this->eventSubscriber = \Drupal::service('stanford_profile.event_subscriber');

/** @var \Drupal\media\MediaTypeInterface $media_type */
$media_type = MediaType::create([
Expand Down

0 comments on commit 3ae5ffb

Please sign in to comment.