/** * @covers ::apply * @covers ::to * @expectedException GanbaroDigital\DIContainers\V1\Exceptions\ContainerIsReadOnly */ public function test_throws_exception_when_container_is_read_only() { // ---------------------------------------------------------------- // setup your test $container = new FactoryListContainer(["hello" => [ContainerIsReadOnly::class, 'newFromVar']]); $container->setReadOnly(); // ---------------------------------------------------------------- // perform the change RequireWriteableContainer::apply()->to($container); // ---------------------------------------------------------------- // test the results }