test exception on kmeans

This commit is contained in:
Arkadiusz Kondas 2016-07-24 14:01:17 +02:00
parent 448eaafd78
commit 403824d23b
2 changed files with 8 additions and 1 deletions

View File

@ -13,5 +13,4 @@ class NormalizerException extends \Exception
{
return new self('Unknown norm supplied.');
}
}

View File

@ -48,4 +48,12 @@ class KMeansTest extends \PHPUnit_Framework_TestCase
$clusters = $kmeans->cluster($samples);
$this->assertEquals(4, count($clusters));
}
/**
* @expectedException \Phpml\Exception\InvalidArgumentException
*/
public function testThrowExceptionOnInvalidClusterNumber()
{
new KMeans(0);
}
}