Skip to content

Commit 60e69d2

Browse files
authored
Merge pull request #82 from carakas/master
Add php 8 support to spoon library
2 parents 8b4429f + cec8fca commit 60e69d2

22 files changed

Lines changed: 132 additions & 48 deletions

.github/workflows/run-tests.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
strategy:
99
fail-fast: true
1010
matrix:
11-
php: [7.1, 7.2, 7.3, 7.4]
11+
php: [7.1, 7.2, 7.3, 7.4, 8.0, 8.1]
1212
testsuite: ["unit"]
1313
name: PHPUnit - ${{ matrix.testsuite }} (PHP ${{ matrix.php }})
1414
services:
@@ -40,9 +40,12 @@ jobs:
4040
- name: Install dependencies
4141
env:
4242
FORK_ENV: test
43+
SYMFONY_DEPRECATIONS_HELPER: "quiet"
4344
run: composer install -o
4445

4546
- name: Execute tests
47+
env:
48+
SYMFONY_DEPRECATIONS_HELPER: "quiet"
4649
run: vendor/bin/simple-phpunit --testsuite=${{ matrix.testsuite}} --coverage-clover=${{ matrix.testsuite}}.clover
4750

4851
- name: Upload Coverage report

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "spoon/library",
33
"type": "library",
4-
"description": "A PHP5 library that is fast, easy to learn and fun!",
4+
"description": "A PHP library that is fast, easy to learn and very much deprecated!",
55
"homepage": "http://www.spoon-library.com",
66
"license": "BSD-2-Clause",
77
"authors": [
@@ -11,9 +11,9 @@
1111
}
1212
],
1313
"require": {
14-
"php": "^7.1"
14+
"php": "^7.1|^8.0"
1515
},
1616
"require-dev": {
17-
"symfony/phpunit-bridge": "^3.3"
17+
"symfony/phpunit-bridge": "^5.3"
1818
}
1919
}

composer.lock

Lines changed: 102 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

spoon/datagrid/datagrid.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1479,7 +1479,7 @@ public function setColumnConfirm($column, $message, $custom = null)
14791479
* @param mixed $columns The columns wherein the result will appear.
14801480
* @param bool[optional] $overwrite Should the result overwrite the current value?
14811481
*/
1482-
public function setColumnFunction($function, $arguments = null, $columns, $overwrite = false)
1482+
public function setColumnFunction($function, $arguments = null, $columns = null, $overwrite = false)
14831483
{
14841484
// has results
14851485
if($this->source->getNumResults() > 0)
@@ -1919,7 +1919,7 @@ public function setSortingColumns(array $columns, $default = null)
19191919
* @param string[optional] $desc The icon for descending.
19201920
* @param string[optional] $descSelected The icon when descending sort is applied.
19211921
*/
1922-
public function setSortingIcons($asc = null, $ascSelected = null, $desc = null, $descSelected)
1922+
public function setSortingIcons($asc = null, $ascSelected = null, $desc = null, $descSelected = null)
19231923
{
19241924
if($asc !== null) $this->sortingIcons['asc'] = (string) $asc;
19251925
if($ascSelected !== null) $this->sortingIcons['ascSelected'] = (string) $ascSelected;

spoon/tests/SpoonTest.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,9 @@ public function testGet()
1616
$this->assertEquals(Spoon::get('stored_value'), $value);
1717
}
1818

19-
/**
20-
* @expectedException SpoonException
21-
*/
2219
public function testGetFailure()
2320
{
21+
$this->expectException(SpoonException::class);
2422
$this->assertEquals('I have no idea what I am doing.', Spoon::get('my_custom_value'));
2523
}
2624

spoon/tests/database/SpoonDatabaseLargeDataSet.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class SpoonDatabaseLargeDataSet extends TestCase
3333
/**
3434
*
3535
*/
36-
public function setup()
36+
public function setup(): void
3737
{
3838
$this->db = new SpoonDatabase('mysql', '127.0.0.1', 'root', 'spoon', 'spoon_tests');
3939
}

spoon/tests/database/SpoonDatabaseTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class SpoonDatabaseTest extends TestCase
1414
*/
1515
protected $db;
1616

17-
public function setup()
17+
public function setup(): void
1818
{
1919
// create database object
2020
$this->db = new SpoonDatabase('mysql', '127.0.0.1', 'root', 'spoon', 'spoon_tests');
@@ -284,8 +284,8 @@ public function testUpdateDate()
284284
*/
285285
public function testOptimize()
286286
{
287-
self::assertArraySubset([], $this->db->optimize('users'));
288-
self::assertArraySubset([], $this->db->optimize(array('users')));
287+
self::assertIsArray($this->db->optimize('users'));
288+
self::assertIsArray($this->db->optimize(array('users')));
289289
}
290290

291291
/**

spoon/tests/directory/SpoonDirectoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class SpoonDirectoryTest extends TestCase
1111
{
1212
protected $path;
1313

14-
protected function setUp()
14+
protected function setup(): void
1515
{
1616
// set path
1717
$this->path = dirname(dirname(__FILE__)) . '/tmp';

spoon/tests/file/SpoonFileTest.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
class SpoonFileTest extends TestCase
1111
{
12-
public function setup()
12+
public function setup(): void
1313
{
1414
if(!defined('TMPPATH')) define('TMPPATH', dirname(realpath(dirname(__FILE__))) . '/tmp');
1515

@@ -27,11 +27,9 @@ public function testDownload()
2727
$this->assertFalse(SpoonFile::download($this->existingUrl, $this->destinationFile, false));
2828
}
2929

30-
/**
31-
* @expectedException SpoonFileException
32-
*/
3330
public function testDownloadFailure()
3431
{
32+
$this->expectException(SpoonFileException::class);
3533
SpoonFile::download($this->nonExistingUrl, $this->destinationFile);
3634
}
3735
}

spoon/tests/form/SpoonFileFieldTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class SpoonFileFieldTest extends TestCase
1919
*/
2020
protected $filePDF;
2121

22-
public function setup()
22+
public function setup(): void
2323
{
2424
$this->frm = new SpoonForm('filefield');
2525
$this->filePDF = new SpoonFormFile('pdf');

0 commit comments

Comments
 (0)