public function testGetPercentageCompletionsProvidedEmail() { $total = 60; $num = (int) rand(1, 50); $expected = round($num / $total * 100, AnalyticsExport::PERCENTAGE_PRECISION); $this->assertInstanceOf(AnalyticsExport::class, $this->instance->setCompletions($total)); $this->assertEquals($total, $this->instance->getCompletions()); $this->assertInstanceOf(AnalyticsExport::class, $this->instance->setProvidedEmailAddress($num)); $this->assertEquals($num, $this->instance->getProvidedEmailAddress()); $this->assertEquals($expected, $this->instance->getPercentageCompletionsProvidedEmail()); }