Skip to content

Commit 38c1d62

Browse files
committed
Version for PHP 8.2 and Symfony 6.4
- Projekt-Informationen angepasst - Test ergänzt
1 parent 4a21fc2 commit 38c1d62

File tree

3 files changed

+30
-37
lines changed

3 files changed

+30
-37
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
MobileDetectBundle
44
==================
55

6-
Symfony 3.4.x-6.0.x bundle to detect mobile devices, manage mobile view and redirect to the mobile and tablet version.
6+
Symfony 6.4.x / PHP 8.2 bundle to detect mobile devices, manage mobile view and redirect to the mobile and tablet version.
77

88
[![Github Actions Status](https://github.com/tattali/MobileDetectBundle/actions/workflows/main.yml/badge.svg?branch=main
99
)](https://github.com/tattali/MobileDetectBundle/actions/workflows/main.yml?query=branch%3Amain) [![Latest Stable Version](http://poser.pugx.org/tattali/mobile-detect-bundle/v)](https://packagist.org/packages/tattali/mobile-detect-bundle) [![Total Downloads](http://poser.pugx.org/tattali/mobile-detect-bundle/downloads)](https://packagist.org/packages/tattali/mobile-detect-bundle) [![codecov](https://codecov.io/gh/tattali/MobileDetectBundle/branch/main/graph/badge.svg?token=HWV1OYRSD9)](https://codecov.io/gh/tattali/MobileDetectBundle) [![License](http://poser.pugx.org/tattali/mobile-detect-bundle/license)](https://packagist.org/packages/tattali/mobile-detect-bundle) [![PHP Version Require](http://poser.pugx.org/tattali/mobile-detect-bundle/require/php)](https://packagist.org/packages/tattali/mobile-detect-bundle)
1010

11-
*This bundle is a fork of [suncat2000/MobileDetectBundle](https://github.com/suncat2000/MobileDetectBundle). As this project doesn't look maintained anymore, we decided to create & maintain a fork. For more information read our [manifest](https://github.com/tattali/MobileDetectBundle/issues/8).*
11+
*This bundle is a fork of [tattali/MobileDetectBundle](https://github.com/tattali/MobileDetectBundle) that is a fork of [suncat2000/MobileDetectBundle](https://github.com/suncat2000/MobileDetectBundle). As this project doesn't look maintained anymore, we decided to create & maintain a fork. For more information read our [manifest](https://github.com/tattali/MobileDetectBundle/issues/8).*
1212

1313
Introduction
1414
------------

composer.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "tattali/mobile-detect-bundle",
3-
"description": "Symfony 6.4 bundle to detect mobile devices, manage mobile view and redirect to the mobile and tablet version.",
2+
"name": "digifa/mobile-detect-bundle",
3+
"description": "Symfony 6.4 / PHP 8.2 bundle to detect mobile devices, manage mobile view and redirect to the mobile and tablet version.",
44
"keywords": [
55
"mobile detect",
66
"device detect",
@@ -12,10 +12,14 @@
1212
"symfony mobiledetect",
1313
"symfony"
1414
],
15-
"homepage": "https://github.com/tattali/MobileDetectBundle",
15+
"homepage": "https://github.com/digifa/MobileDetectBundle",
1616
"type": "symfony-bundle",
1717
"license": "MIT",
1818
"authors": [
19+
{
20+
"name": "Guido Faust",
21+
"email": "gfaust@digifa.de"
22+
},
1923
{
2024
"name": "Théo Attali",
2125
"email": "theoattali@gmail.com"

tests/Twig/Extension/MobileDetectExtensionTest.php

Lines changed: 21 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -68,38 +68,6 @@ protected function setUp(): void
6868
];
6969
}
7070

71-
public function testGetFunctionsArray(): void
72-
{
73-
$deviceView = new DeviceView($this->requestStack);
74-
$extension = new MobileDetectExtension($this->requestStack, $this->mobileDetector, $deviceView, $this->config);
75-
76-
$functions = $extension->getFunctions();
77-
self::assertCount(13, $functions);
78-
$names = [
79-
'is_mobile' => 'isMobile',
80-
'is_tablet' => 'isTablet',
81-
'is_device' => 'isDevice',
82-
'is_full_view' => 'isFullView',
83-
'is_mobile_view' => 'isMobileView',
84-
'is_tablet_view' => 'isTabletView',
85-
'is_not_mobile_view' => 'isNotMobileView',
86-
'is_ios' => 'isIOS',
87-
'is_android_os' => 'isAndroidOS',
88-
'is_windows_os' => 'isWindowsOS',
89-
'full_view_url' => 'fullViewUrl',
90-
'device_version' => 'deviceVersion',
91-
'rules_list' => 'getRules',
92-
];
93-
foreach ($functions as $function) {
94-
self::assertInstanceOf(TwigFunction::class, $function);
95-
$name = $function->getName();
96-
$callable = $function->getCallable();
97-
self::assertArrayHasKey($name, $names);
98-
self::assertIsArray($callable);
99-
self::assertSame($names[$name], $callable[1]);
100-
}
101-
}
102-
10371
public function testRulesList(): void
10472
{
10573
$deviceView = new DeviceView($this->requestStack);
@@ -368,4 +336,25 @@ public function testIsWindowsOSFalse(): void
368336
$extension = new MobileDetectExtension($this->requestStack, $this->mobileDetector, $deviceView, $this->config);
369337
self::assertFalse($extension->isWindowsOS());
370338
}
339+
340+
public function testGetFunctions(): void
341+
{
342+
$deviceView = new DeviceView($this->requestStack);
343+
$extension = new MobileDetectExtension($this->requestStack, $this->mobileDetector, $deviceView, $this->config);
344+
$functions = $extension->getFunctions();
345+
346+
self::assertCount(13, $functions);
347+
self::assertInstanceOf(TwigFunction::class, $functions[0]);
348+
self::assertInstanceOf(TwigFunction::class, $functions[1]);
349+
self::assertInstanceOf(TwigFunction::class, $functions[2]);
350+
self::assertInstanceOf(TwigFunction::class, $functions[3]);
351+
self::assertInstanceOf(TwigFunction::class, $functions[4]);
352+
self::assertInstanceOf(TwigFunction::class, $functions[5]);
353+
self::assertInstanceOf(TwigFunction::class, $functions[6]);
354+
self::assertInstanceOf(TwigFunction::class, $functions[7]);
355+
self::assertInstanceOf(TwigFunction::class, $functions[8]);
356+
self::assertInstanceOf(TwigFunction::class, $functions[9]);
357+
self::assertInstanceOf(TwigFunction::class, $functions[10]);
358+
self::assertInstanceOf(TwigFunction::class, $functions[11]);
359+
}
371360
}

0 commit comments

Comments
 (0)