Skip to content

Commit e33a28b

Browse files
committed
URL Test
1 parent 2c4f723 commit e33a28b

File tree

4 files changed

+38
-15
lines changed

4 files changed

+38
-15
lines changed

.github/workflows/phpunit.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ jobs:
6565
- name: Copy and install Addons
6666
run: |
6767
rsync -av --exclude='./vendor' --exclude='.github' --exclude='.git' --exclude='redaxo_cms' './' 'redaxo_cms/redaxo/src/addons/${{ github.event.repository.name }}'
68+
redaxo_cms/redaxo/bin/console package:install 'yform'
69+
redaxo_cms/redaxo/bin/console package:install 'cronjob'
6870
redaxo_cms/redaxo/bin/console package:install '${{ github.event.repository.name }}'
6971
7072
# install dependencies from composer.json

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ modules.xml
1212
.idea/vcs.xml
1313
.idea/encodings.xml
1414
*.ipr
15-
.php-cs-fixer.cache
15+
.php-cs-fixer.cache
16+
.phpunit.result.cache

tests/dummy_test.php

Lines changed: 0 additions & 14 deletions
This file was deleted.

tests/url_test.php

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?php
2+
3+
use PHPUnit\Framework\TestCase;
4+
5+
/**
6+
* @internal
7+
*/
8+
class rex_diff_detect_url_test extends TestCase
9+
{
10+
public function testSettings()
11+
{
12+
$id = 999999;
13+
rex_sql::factory()->setQuery('delete from `' . rex::getTable('diff_detect_url') . '` where id=:id', [
14+
'id' => $id,
15+
]);
16+
17+
rex_sql::factory()->setQuery('insert into `' . rex::getTable('diff_detect_url') . '` set id=:id, name=:name, url=:url, type=:type, status=:status', [
18+
'id' => $id,
19+
'name' => 'REDAXO ' . random_int(1000, 9999),
20+
'url' => 'https://redaxo.org',
21+
'type' => 'html',
22+
'status' => 1,
23+
]);
24+
25+
$url = FriendsOfRedaxo\DiffDetect\Url::get($id);
26+
27+
static::assertNotNull($url);
28+
29+
rex_sql::factory()->setQuery('delete from `' . rex::getTable('diff_detect_url') . '` where id=:id', [
30+
'id' => $id,
31+
]);
32+
33+
}
34+
}

0 commit comments

Comments
 (0)