/** * @covers \espend\IdeaBadge\Poser\Provider\PoserLastMonthStorage::put */ public function testThatCurrentMonthIsSaved() { $storage = new PoserLastMonthStorage($this->temp); $storage->put('5000', 500000); $json = json_decode(file_get_contents($this->temp), true); static::assertEquals(500000, current($json['5000'])); }
/** * @param PluginDownloadsFetchedEvent $event */ public function onDownloadsFetched(PluginDownloadsFetchedEvent $event) { $this->storage->put($event->getId(), $event->getDownloads()); }