/** * @dataProvider isTriangularSquareData */ public function testIsTriangularSquare($t, $result) { $triObj = new Triangular(); $this->assertEquals($triObj->isTriangularSquare($t), $result); }
/** * Output the triangular numbers that are also square, up to a specified position. * * @param $max int Maximum position to check for triangular numbers that are also square. */ function tri_square_upto($max) { try { require 'api_classes/triangular.php'; $triObj = new \Triangular(); $triObj->getTriangularSquaresUpTo($max); $triObj->output(); } catch (\Exception $e) { } }