-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathBadMethodCallExceptionTest.php
33 lines (27 loc) · 1.08 KB
/
BadMethodCallExceptionTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
namespace PHPWatch\SimpleContainer\Tests\Exception;
use PHPWatch\SimpleContainer\Container;
use PHPWatch\SimpleContainer\Exception\BadMethodCallException;
use PHPUnit\Framework\TestCase;
class BadMethodCallExceptionTest extends TestCase {
public function testMarkProtectedWithoutClosure(): void {
$container = new Container();
$this->expectException(BadMethodCallException::class);
$container->setProtected('foo');
}
public function testMarkFactoryWithoutClosure(): void {
$container = new Container();
$this->expectException(BadMethodCallException::class);
$container->setFactory('foo');
}
public function testMarkStaticAsFactory(): void {
$container = new Container(['foo' => 115628]);
$this->expectException(BadMethodCallException::class);
$container->setFactory('foo');
}
public function testMarkStaticAsProtected(): void {
$container = new Container(['foo' => 115628]);
$this->expectException(BadMethodCallException::class);
$container->setProtected('foo');
}
}