Skip to content

Commit

Permalink
Update phpunit to 6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
akondas committed Feb 3, 2017
1 parent 8f122fd commit 858d13b
Show file tree
Hide file tree
Showing 58 changed files with 251 additions and 253 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"type": "library",
"description": "PHP-ML - Machine Learning library for PHP",
"license": "MIT",
"keywords": ["machine learning","pattern recognition","neural network","computational learning theory","artificial intelligence"],
"keywords": ["machine learning","pattern recognition","neural network","computational learning theory","artificial intelligence","data science","feature extraction"],
"homepage": "https://github.com/php-ai/php-ml",
"authors": [
{
Expand All @@ -20,7 +20,7 @@
"php": ">=7.0.0"
},
"require-dev": {
"phpunit/phpunit": "^5.5"
"phpunit/phpunit": "^6.0"
},
"config": {
"bin-dir": "bin"
Expand Down
323 changes: 136 additions & 187 deletions composer.lock

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion src/Phpml/Exception/SerializeException.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,4 @@ public static function cantSerialize(string $classname)
{
return new self(sprintf('Class "%s" can not be serialized.', $classname));
}

}
3 changes: 2 additions & 1 deletion tests/Phpml/Association/AprioriTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@

use Phpml\Association\Apriori;
use Phpml\ModelManager;
use PHPUnit\Framework\TestCase;

class AprioriTest extends \PHPUnit_Framework_TestCase
class AprioriTest extends TestCase
{
private $sampleGreek = [
['alpha', 'beta', 'epsilon'],
Expand Down
4 changes: 2 additions & 2 deletions tests/Phpml/Classification/DecisionTreeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@

use Phpml\Classification\DecisionTree;
use Phpml\ModelManager;
use PHPUnit\Framework\TestCase;

class DecisionTreeTest extends \PHPUnit_Framework_TestCase
class DecisionTreeTest extends TestCase
{
private $data = [
['sunny', 85, 85, 'false', 'Dont_play' ],
Expand Down Expand Up @@ -73,7 +74,6 @@ public function testSaveAndRestore()
$restoredClassifier = $modelManager->restoreFromFile($filepath);
$this->assertEquals($classifier, $restoredClassifier);
$this->assertEquals($predicted, $restoredClassifier->predict($testSamples));

}

public function testTreeDepth()
Expand Down
3 changes: 2 additions & 1 deletion tests/Phpml/Classification/KNearestNeighborsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
use Phpml\Classification\KNearestNeighbors;
use Phpml\Math\Distance\Chebyshev;
use Phpml\ModelManager;
use PHPUnit\Framework\TestCase;

class KNearestNeighborsTest extends \PHPUnit_Framework_TestCase
class KNearestNeighborsTest extends TestCase
{
public function testPredictSingleSampleWithDefaultK()
{
Expand Down
5 changes: 2 additions & 3 deletions tests/Phpml/Classification/NaiveBayesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@

use Phpml\Classification\NaiveBayes;
use Phpml\ModelManager;
use PHPUnit\Framework\TestCase;

class NaiveBayesTest extends \PHPUnit_Framework_TestCase
class NaiveBayesTest extends TestCase
{
public function testPredictSingleSample()
{
Expand Down Expand Up @@ -44,7 +45,6 @@ public function testPredictArrayOfSamples()
$testSamples = [[1, 1, 6], [5, 1, 1]];
$testLabels = ['d', 'a'];
$this->assertEquals($testLabels, $classifier->predict($testSamples));

}

public function testSaveAndRestore()
Expand All @@ -68,5 +68,4 @@ public function testSaveAndRestore()
$this->assertEquals($classifier, $restoredClassifier);
$this->assertEquals($predicted, $restoredClassifier->predict($testSamples));
}

}
3 changes: 2 additions & 1 deletion tests/Phpml/Classification/SVCTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
use Phpml\Classification\SVC;
use Phpml\SupportVectorMachine\Kernel;
use Phpml\ModelManager;
use PHPUnit\Framework\TestCase;

class SVCTest extends \PHPUnit_Framework_TestCase
class SVCTest extends TestCase
{
public function testPredictSingleSampleWithLinearKernel()
{
Expand Down
3 changes: 2 additions & 1 deletion tests/Phpml/Clustering/DBSCANTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
namespace tests\Clustering;

use Phpml\Clustering\DBSCAN;
use PHPUnit\Framework\TestCase;

class DBSCANTest extends \PHPUnit_Framework_TestCase
class DBSCANTest extends TestCase
{
public function testDBSCANSamplesClustering()
{
Expand Down
3 changes: 2 additions & 1 deletion tests/Phpml/Clustering/FuzzyCMeansTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
namespace tests\Clustering;

use Phpml\Clustering\FuzzyCMeans;
use PHPUnit\Framework\TestCase;

class FuzzyCMeansTest extends \PHPUnit_Framework_TestCase
class FuzzyCMeansTest extends TestCase
{
public function testFCMSamplesClustering()
{
Expand Down
3 changes: 2 additions & 1 deletion tests/Phpml/Clustering/KMeansTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
namespace tests\Clustering;

use Phpml\Clustering\KMeans;
use PHPUnit\Framework\TestCase;

class KMeansTest extends \PHPUnit_Framework_TestCase
class KMeansTest extends TestCase
{
public function testKMeansSamplesClustering()
{
Expand Down
3 changes: 2 additions & 1 deletion tests/Phpml/CrossValidation/RandomSplitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@

use Phpml\CrossValidation\RandomSplit;
use Phpml\Dataset\ArrayDataset;
use PHPUnit\Framework\TestCase;

class RandomSplitTest extends \PHPUnit_Framework_TestCase
class RandomSplitTest extends TestCase
{
/**
* @expectedException \Phpml\Exception\InvalidArgumentException
Expand Down
3 changes: 2 additions & 1 deletion tests/Phpml/CrossValidation/StratifiedRandomSplitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@

use Phpml\CrossValidation\StratifiedRandomSplit;
use Phpml\Dataset\ArrayDataset;
use PHPUnit\Framework\TestCase;

class StratifiedRandomSplitTest extends \PHPUnit_Framework_TestCase
class StratifiedRandomSplitTest extends TestCase
{
public function testDatasetStratifiedRandomSplitWithEvenDistribution()
{
Expand Down
3 changes: 2 additions & 1 deletion tests/Phpml/Dataset/ArrayDatasetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
namespace tests\Phpml\Dataset;

use Phpml\Dataset\ArrayDataset;
use PHPUnit\Framework\TestCase;

class ArrayDatasetTest extends \PHPUnit_Framework_TestCase
class ArrayDatasetTest extends TestCase
{
/**
* @expectedException \Phpml\Exception\InvalidArgumentException
Expand Down
3 changes: 2 additions & 1 deletion tests/Phpml/Dataset/CsvDatasetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
namespace tests\Phpml\Dataset;

use Phpml\Dataset\CsvDataset;
use PHPUnit\Framework\TestCase;

class CsvDatasetTest extends \PHPUnit_Framework_TestCase
class CsvDatasetTest extends TestCase
{
/**
* @expectedException \Phpml\Exception\FileException
Expand Down
3 changes: 2 additions & 1 deletion tests/Phpml/Dataset/Demo/GlassDatasetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
namespace tests\Phpml\Dataset\Demo;

use Phpml\Dataset\Demo\GlassDataset;
use PHPUnit\Framework\TestCase;

class GlassDatasetTest extends \PHPUnit_Framework_TestCase
class GlassDatasetTest extends TestCase
{
public function testLoadingWineDataset()
{
Expand Down
3 changes: 2 additions & 1 deletion tests/Phpml/Dataset/Demo/IrisDatasetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
namespace tests\Phpml\Dataset\Demo;

use Phpml\Dataset\Demo\IrisDataset;
use PHPUnit\Framework\TestCase;

class IrisDatasetTest extends \PHPUnit_Framework_TestCase
class IrisDatasetTest extends TestCase
{
public function testLoadingIrisDataset()
{
Expand Down
3 changes: 2 additions & 1 deletion tests/Phpml/Dataset/Demo/WineDatasetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
namespace tests\Phpml\Dataset\Demo;

use Phpml\Dataset\Demo\WineDataset;
use PHPUnit\Framework\TestCase;

class WineDatasetTest extends \PHPUnit_Framework_TestCase
class WineDatasetTest extends TestCase
{
public function testLoadingWineDataset()
{
Expand Down
3 changes: 2 additions & 1 deletion tests/Phpml/Dataset/FilesDatasetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
namespace tests\Phpml\Dataset;

use Phpml\Dataset\FilesDataset;
use PHPUnit\Framework\TestCase;

class FilesDatasetTest extends \PHPUnit_Framework_TestCase
class FilesDatasetTest extends TestCase
{
/**
* @expectedException \Phpml\Exception\DatasetException
Expand Down
3 changes: 2 additions & 1 deletion tests/Phpml/FeatureExtraction/StopWordsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
namespace tests\Phpml\FeatureExtraction;

use Phpml\FeatureExtraction\StopWords;
use PHPUnit\Framework\TestCase;

class StopWordsTest extends \PHPUnit_Framework_TestCase
class StopWordsTest extends TestCase
{
public function testCustomStopWords()
{
Expand Down
3 changes: 2 additions & 1 deletion tests/Phpml/FeatureExtraction/TfIdfTransformerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
namespace tests\Phpml\FeatureExtraction;

use Phpml\FeatureExtraction\TfIdfTransformer;
use PHPUnit\Framework\TestCase;

class TfIdfTransformerTest extends \PHPUnit_Framework_TestCase
class TfIdfTransformerTest extends TestCase
{
public function testTfIdfTransformation()
{
Expand Down
3 changes: 2 additions & 1 deletion tests/Phpml/FeatureExtraction/TokenCountVectorizerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
use Phpml\FeatureExtraction\StopWords;
use Phpml\FeatureExtraction\TokenCountVectorizer;
use Phpml\Tokenization\WhitespaceTokenizer;
use PHPUnit\Framework\TestCase;

class TokenCountVectorizerTest extends \PHPUnit_Framework_TestCase
class TokenCountVectorizerTest extends TestCase
{
public function testTransformationWithWhitespaceTokenizer()
{
Expand Down
3 changes: 2 additions & 1 deletion tests/Phpml/Math/Distance/ChebyshevTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
namespace tests\Phpml\Metric;

use Phpml\Math\Distance\Chebyshev;
use PHPUnit\Framework\TestCase;

class ChebyshevTest extends \PHPUnit_Framework_TestCase
class ChebyshevTest extends TestCase
{
/**
* @var Chebyshev
Expand Down
3 changes: 2 additions & 1 deletion tests/Phpml/Math/Distance/EuclideanTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
namespace tests\Phpml\Metric;

use Phpml\Math\Distance\Euclidean;
use PHPUnit\Framework\TestCase;

class EuclideanTest extends \PHPUnit_Framework_TestCase
class EuclideanTest extends TestCase
{
/**
* @var Euclidean
Expand Down
3 changes: 2 additions & 1 deletion tests/Phpml/Math/Distance/ManhattanTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
namespace tests\Phpml\Metric;

use Phpml\Math\Distance\Manhattan;
use PHPUnit\Framework\TestCase;

class ManhattanTest extends \PHPUnit_Framework_TestCase
class ManhattanTest extends TestCase
{
/**
* @var Manhattan
Expand Down
3 changes: 2 additions & 1 deletion tests/Phpml/Math/Distance/MinkowskiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
namespace tests\Phpml\Metric;

use Phpml\Math\Distance\Minkowski;
use PHPUnit\Framework\TestCase;

class MinkowskiTest extends \PHPUnit_Framework_TestCase
class MinkowskiTest extends TestCase
{
/**
* @var Minkowski
Expand Down
3 changes: 2 additions & 1 deletion tests/Phpml/Math/Kernel/RBFTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
namespace test\Phpml\Math\Kernel;

use Phpml\Math\Kernel\RBF;
use PHPUnit\Framework\TestCase;

class RBFTest extends \PHPUnit_Framework_TestCase
class RBFTest extends TestCase
{
public function testComputeRBFKernelFunction()
{
Expand Down
3 changes: 2 additions & 1 deletion tests/Phpml/Math/MatrixTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
namespace tests\Phpml\Math;

use Phpml\Math\Matrix;
use PHPUnit\Framework\TestCase;

class MatrixTest extends \PHPUnit_Framework_TestCase
class MatrixTest extends TestCase
{
/**
* @expectedException \Phpml\Exception\InvalidArgumentException
Expand Down
3 changes: 2 additions & 1 deletion tests/Phpml/Math/ProductTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
namespace tests\Phpml\Math;

use Phpml\Math\Product;
use PHPUnit\Framework\TestCase;

class ProductTest extends \PHPUnit_Framework_TestCase
class ProductTest extends TestCase
{
public function testScalarProduct()
{
Expand Down
7 changes: 5 additions & 2 deletions tests/Phpml/Math/SetTest.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
<?php declare(strict_types=1);
<?php

declare(strict_types=1);

namespace tests\Phpml\Math;

use Phpml\Math\Set;
use PHPUnit\Framework\TestCase;

class SetTest extends \PHPUnit_Framework_TestCase
class SetTest extends TestCase
{
public function testUnion()
{
Expand Down
3 changes: 2 additions & 1 deletion tests/Phpml/Math/Statistic/CorrelationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
namespace test\Phpml\Math\StandardDeviation;

use Phpml\Math\Statistic\Correlation;
use PHPUnit\Framework\TestCase;

class CorrelationTest extends \PHPUnit_Framework_TestCase
class CorrelationTest extends TestCase
{
public function testPearsonCorrelation()
{
Expand Down
3 changes: 2 additions & 1 deletion tests/Phpml/Math/Statistic/MeanTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
namespace test\Phpml\Math\StandardDeviation;

use Phpml\Math\Statistic\Mean;
use PHPUnit\Framework\TestCase;

class MeanTest extends \PHPUnit_Framework_TestCase
class MeanTest extends TestCase
{
/**
* @expectedException \Phpml\Exception\InvalidArgumentException
Expand Down
3 changes: 2 additions & 1 deletion tests/Phpml/Math/Statistic/StandardDeviationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
namespace test\Phpml\Math\StandardDeviation;

use Phpml\Math\Statistic\StandardDeviation;
use PHPUnit\Framework\TestCase;

class StandardDeviationTest extends \PHPUnit_Framework_TestCase
class StandardDeviationTest extends TestCase
{
public function testStandardDeviationOfPopulationSample()
{
Expand Down
3 changes: 2 additions & 1 deletion tests/Phpml/Metric/AccuracyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
use Phpml\Dataset\Demo\IrisDataset;
use Phpml\Metric\Accuracy;
use Phpml\SupportVectorMachine\Kernel;
use PHPUnit\Framework\TestCase;

class AccuracyTest extends \PHPUnit_Framework_TestCase
class AccuracyTest extends TestCase
{
/**
* @expectedException \Phpml\Exception\InvalidArgumentException
Expand Down
Loading

0 comments on commit 858d13b

Please sign in to comment.