public function testGetPercentageOfDropouts() { $total = 100; $num = (int) rand(1, 50); $expected = round(($total - $num) / $total * 100, AnalyticsExport::PERCENTAGE_PRECISION); $this->assertInstanceOf(AnalyticsExport::class, $this->instance->setStarts($total)); $this->assertEquals($total, $this->instance->getStarts()); $this->assertInstanceOf(AnalyticsExport::class, $this->instance->setCompletions($num)); $this->assertEquals($num, $this->instance->getCompletions()); $this->assertEquals($expected, $this->instance->getPercentageOfDropouts()); }