/**
  * @test
  * @expectedException \Exception
  */
 public function it_throws_exception_when_requesting_prototype_while_it_is_disabled()
 {
     $options = ['type' => 'text', 'prototype' => false];
     $childFormCollection = new CollectionType('emails', 'collection', $this->plainForm, $options);
     $childFormCollection->render();
     $childFormCollection->prototype();
 }
    /**
     * @test
     */
    public function it_throws_exception_when_requesting_prototype_while_it_is_disabled()
    {
        $options = [
            'type' => 'text',
            'prototype' => false
        ];

        $this->fieldExpetations('collection', Mockery::any());
        $this->request->shouldReceive('old');

        $childFormCollection = new CollectionType('emails', 'collection', $this->plainForm, $options);

        $childFormCollection->render();

        try {
            $childFormCollection->prototype();
        } catch (\Exception $e) {
            return;
        }

        $this->fail('Exception was not thrown when asked for prototype when disabled.');
    }