Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
chdemko committed Aug 4, 2024
1 parent 1fb3d36 commit 4de94e8
Show file tree
Hide file tree
Showing 9 changed files with 821 additions and 956 deletions.
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
"php": ">=8.1"
},
"require-dev": {
"php-coveralls/php-coveralls": "^2.6",
"squizlabs/php_codesniffer": "^3.7",
"phpunit/phpunit": "^10.2",
"phpbench/phpbench": "^1.2"
"php-coveralls/php-coveralls": "^2.7",
"squizlabs/php_codesniffer": "^3.10",
"phpunit/phpunit": "^11.3",
"phpbench/phpbench": "^1.3"
},
"autoload": {
"psr-4": {
Expand Down
877 changes: 445 additions & 432 deletions composer.lock

Large diffs are not rendered by default.

96 changes: 37 additions & 59 deletions tests/SortedCollection/ReversedMapTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
// Declare chdemko\SortedCollection namespace
namespace chdemko\SortedCollection;

use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;

/**
Expand All @@ -31,13 +32,12 @@ class ReversedMapTest extends TestCase
*
* @return void
*
* @covers chdemko\SortedCollection\ReversedMap::__construct
* @covers chdemko\SortedCollection\ReversedMap::create
* @covers chdemko\SortedCollection\ReversedMap::__get
* @covers chdemko\SortedCollection\ReversedMap::comparator
*
* @since 1.0.0
*/
#[CoversFunction('chdemko\SortedCollection\ReversedMap::__construct')]
#[CoversFunction('chdemko\SortedCollection\ReversedMap::create')]
#[CoversFunction('chdemko\SortedCollection\ReversedMap::__get')]
#[CoversFunction('chdemko\SortedCollection\ReversedMap::comparator')]
public function testConstruct()
{
$tree = TreeMap::create()->initialise(array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9));
Expand Down Expand Up @@ -71,10 +71,9 @@ public function testConstruct()
*
* @return void
*
* @covers chdemko\SortedCollection\ReversedMap::first
*
* @since 1.0.0
*/
#[CoversFunction('chdemko\SortedCollection\ReversedMap::first')]
public function testFirst()
{
$tree = TreeMap::create()->initialise(array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9));
Expand All @@ -91,10 +90,9 @@ public function testFirst()
*
* @return void
*
* @covers chdemko\SortedCollection\ReversedMap::last
*
* @since 1.0.0
*/
#[CoversFunction('chdemko\SortedCollection\ReversedMap::last')]
public function testLast()
{
$tree = TreeMap::create()->initialise(array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9));
Expand All @@ -111,11 +109,10 @@ public function testLast()
*
* @return void
*
* @covers chdemko\SortedCollection\ReversedMap::predecessor
* @covers chdemko\SortedCollection\AbstractMap::predecessor
*
* @since 1.0.0
*/
#[CoversFunction('chdemko\SortedCollection\ReversedMap::predecessor')]
#[CoversFunction('chdemko\SortedCollection\AbstractMap::predecessor')]
public function testPredecessor()
{
$tree = TreeMap::create()->initialise(array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9));
Expand All @@ -133,11 +130,10 @@ public function testPredecessor()
*
* @return void
*
* @covers chdemko\SortedCollection\ReversedMap::successor
* @covers chdemko\SortedCollection\AbstractMap::successor
*
* @since 1.0.0
*/
#[CoversFunction('chdemko\SortedCollection\ReversedMap::successor')]
#[CoversFunction('chdemko\SortedCollection\AbstractMap::successor')]
public function testSuccessor()
{
$tree = TreeMap::create()->initialise(array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9));
Expand Down Expand Up @@ -179,13 +175,11 @@ public static function casesLowerKey()
*
* @return void
*
* @covers chdemko\SortedCollection\ReversedMap::lower
* @covers chdemko\SortedCollection\AbstractMap::lowerKey
*
* @dataProvider casesLowerKey
*
* @since 1.0.0
*/
#[DataProvider('casesLowerKey')]
#[CoversFunction('chdemko\SortedCollection\ReversedMap::lower')]
#[CoversFunction('chdemko\SortedCollection\AbstractMap::lowerKey')]
public function testLowerKey($values, $key, $expected, $exception)
{
if ($exception) {
Expand Down Expand Up @@ -230,13 +224,11 @@ public static function casesFloorKey()
*
* @return void
*
* @covers chdemko\SortedCollection\ReversedMap::floor
* @covers chdemko\SortedCollection\AbstractMap::floorKey
*
* @dataProvider casesFloorKey
*
* @since 1.0.0
*/
#[DataProvider('casesFloorKey')]
#[CoversFunction('chdemko\SortedCollection\ReversedMap::floor')]
#[CoversFunction('chdemko\SortedCollection\AbstractMap::floorKey')]
public function testFloorKey($values, $key, $found, $exception)
{
if ($exception) {
Expand All @@ -257,11 +249,10 @@ public function testFloorKey($values, $key, $found, $exception)
*
* @return void
*
* @covers chdemko\SortedCollection\ReversedMap::find
* @covers chdemko\SortedCollection\AbstractMap::findKey
*
* @since 1.0.0
*/
#[CoversFunction('chdemko\SortedCollection\ReversedMap::find')]
#[CoversFunction('chdemko\SortedCollection\AbstractMap::findKey')]
public function testFindKey()
{
$tree = TreeMap::create()->initialise(array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9));
Expand Down Expand Up @@ -307,13 +298,11 @@ public static function casesCeilingKey()
*
* @return void
*
* @covers chdemko\SortedCollection\ReversedMap::ceiling
* @covers chdemko\SortedCollection\AbstractMap::floorKey
*
* @dataProvider casesCeilingKey
*
* @since 1.0.0
*/
#[DataProvider('casesCeilingKey')]
#[CoversFunction('chdemko\SortedCollection\ReversedMap::ceiling')]
#[CoversFunction('chdemko\SortedCollection\AbstractMap::floorKey')]
public function testCeilingKey($values, $key, $expected, $exception)
{
if ($exception) {
Expand Down Expand Up @@ -358,13 +347,11 @@ public static function casesHigherKey()
*
* @return void
*
* @covers chdemko\SortedCollection\ReversedMap::higher
* @covers chdemko\SortedCollection\AbstractMap::higherKey
*
* @dataProvider casesHigherKey
*
* @since 1.0.0
*/
#[DataProvider('casesHigherKey')]
#[CoversFunction('chdemko\SortedCollection\ReversedMap::higher')]
#[CoversFunction('chdemko\SortedCollection\AbstractMap::higherKey')]
public function testHigherKey($values, $key, $expected, $exception)
{
if ($exception) {
Expand All @@ -385,11 +372,10 @@ public function testHigherKey($values, $key, $expected, $exception)
*
* @return void
*
* @covers chdemko\SortedCollection\ReversedMap::keys
* @covers chdemko\SortedCollection\AbstractMap::__get
*
* @since 1.0.0
*/
#[CoversFunction('chdemko\SortedCollection\ReversedMap::keys')]
#[CoversFunction('chdemko\SortedCollection\AbstractMap::__get')]
public function testKeys()
{
$empty = true;
Expand Down Expand Up @@ -417,11 +403,10 @@ public function testKeys()
*
* @return void
*
* @covers chdemko\SortedCollection\AbstractMap::values
* @covers chdemko\SortedCollection\AbstractMap::__get
*
* @since 1.0.0
*/
#[CoversFunction('chdemko\SortedCollection\AbstractMap::values')]
#[CoversFunction('chdemko\SortedCollection\AbstractMap::__get')]
public function testValues()
{
$empty = true;
Expand Down Expand Up @@ -473,12 +458,10 @@ public static function casesOffsetGet()
*
* @return void
*
* @covers chdemko\SortedCollection\AbstractMap::offsetGet
*
* @dataProvider casesOffsetGet
*
* @since 1.0.0
*/
#[DataProvider('casesOffsetGet')]
#[CoversFunction('chdemko\SortedCollection\AbstractMap::offsetGet')]
public function testOffsetGet($values, $key, $value, $exception)
{
if ($exception) {
Expand All @@ -499,10 +482,9 @@ public function testOffsetGet($values, $key, $value, $exception)
*
* @return void
*
* @covers chdemko\SortedCollection\AbstractMap::offsetSet
*
* @since 1.0.0
*/
#[CoversFunction('chdemko\SortedCollection\AbstractMap::offsetSet')]
public function testOffsetSet()
{
$this->expectException('RuntimeException');
Expand All @@ -517,10 +499,9 @@ public function testOffsetSet()
*
* @return void
*
* @covers chdemko\SortedCollection\ReversedMap::offsetExists
*
* @since 1.0.0
*/
#[CoversFunction('chdemko\SortedCollection\ReversedMap::offsetExists')]
public function testOffsetExists()
{
$tree = TreeMap::create();
Expand All @@ -545,10 +526,9 @@ public function testOffsetExists()
*
* @return void
*
* @covers chdemko\SortedCollection\AbstractMap::offsetUnset
*
* @since 1.0.0
*/
#[CoversFunction('chdemko\SortedCollection\AbstractMap::offsetUnset')]
public function testOffsetUnset()
{
$this->expectException('RuntimeException');
Expand All @@ -563,11 +543,10 @@ public function testOffsetUnset()
*
* @return void
*
* @covers chdemko\SortedCollection\ReversedMap::count
* @covers chdemko\SortedCollection\AbstractMap::__get
*
* @since 1.0.0
*/
#[CoversFunction('chdemko\SortedCollection\ReversedMap::count')]
#[CoversFunction('chdemko\SortedCollection\AbstractMap::__get')]
public function testCount()
{
$tree = TreeMap::create();
Expand All @@ -591,10 +570,9 @@ public function testCount()
*
* @return void
*
* @covers chdemko\SortedCollection\ReversedMap::jsonSerialize
*
* @since 1.0.0
*/
#[CoversFunction('chdemko\SortedCollection\ReversedMap::jsonSerialize')]
public function testJsonSerialize()
{
$tree = TreeMap::create();
Expand Down
23 changes: 9 additions & 14 deletions tests/SortedCollection/ReversedSetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
// Declare chdemko\SortedCollection namespace
namespace chdemko\SortedCollection;

use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;

/**
Expand Down Expand Up @@ -59,13 +60,11 @@ function ($key1, $key2) {
*
* @return void
*
* @covers chdemko\SortedCollection\ReversedSet::__construct
* @covers chdemko\SortedCollection\ReversedSet::create
*
* @dataProvider casesCreate
*
* @since 1.0.0
*/
#[DataProvider('casesCreate')]
#[CoversFunction('chdemko\SortedCollection\ReversedSet::__construct')]
#[CoversFunction('chdemko\SortedCollection\ReversedSet::create')]
public function testCreate($values, $key, $comparator, $string)
{
$set = TreeSet::create($comparator)->initialise($values);
Expand All @@ -81,11 +80,10 @@ public function testCreate($values, $key, $comparator, $string)
*
* @return void
*
* @covers chdemko\SortedCollection\ReversedSet::__get
* @covers chdemko\SortedCollection\AbstractSet::__get
*
* @since 1.0.0
*/
#[CoversFunction('chdemko\SortedCollection\ReversedSet::__get')]
#[CoversFunction('chdemko\SortedCollection\AbstractSet::__get')]
public function testGet()
{
$set = TreeSet::create()->initialise(array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9));
Expand All @@ -105,10 +103,9 @@ public function testGet()
*
* @return void
*
* @covers chdemko\SortedCollection\ReversedSet::offsetSet
*
* @since 1.0.0
*/
#[CoversFunction('chdemko\SortedCollection\ReversedSet::offsetSet')]
public function testOffsetSet()
{
$this->expectException('RuntimeException');
Expand All @@ -123,10 +120,9 @@ public function testOffsetSet()
*
* @return void
*
* @covers chdemko\SortedCollection\AbstractSet::offsetUnset
*
* @since 1.0.0
*/
#[CoversFunction('chdemko\SortedCollection\AbstractSet::offsetUnset')]
public function testOffsetUnset()
{
$this->expectException('RuntimeException');
Expand All @@ -141,10 +137,9 @@ public function testOffsetUnset()
*
* @return void
*
* @covers chdemko\SortedCollection\ReversedSet::jsonSerialize
*
* @since 1.0.0
*/
#[CoversFunction('chdemko\SortedCollection\ReversedSet::jsonSerialize')]
public function testJsonSerialize()
{
$set = TreeSet::create();
Expand Down
Loading

0 comments on commit 4de94e8

Please sign in to comment.