ILIAS  release_7 Revision v7.30-3-g800a261c036
StorageOnPathWrapperTest.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 2019 Richard Klees <richard.klees@concepts-and-training.de> Extended GPL, see docs/LICENSE */
4
6
9use PHPUnit\Framework\TestCase;
10
11class StorageOnPathWrapperTest extends TestCase
12{
13 const PATH = "path";
14
15 public function setUp() : void
16 {
17 $this->storage = $this->createMock(Metrics\Storage::class);
18 $this->wrapper = new Metrics\StorageOnPathWrapper(self::PATH, $this->storage);
19 }
20
21 public function testStoresToPath()
22 {
23 $key = "key";
24 $m = new M(M::STABILITY_CONFIG, M::TYPE_BOOL, true, "desc");
25
26 $this->storage->expects($this->once())
27 ->method("store")
28 ->with(self::PATH . "." . $key, $m);
29
30 $this->wrapper->store($key, $m);
31 }
32}
An exception for terminatinating execution or to throw for unit testing.
A metric is something we can measure about the system.
Definition: Metric.php:18
const PATH
Definition: proxy_ylocal.php:8