How to throw an Exception with a Mock object on method call in PHPUnit

Code
<?php

use PHPUnit\Framework\TestCase;

class 
ExceptionMockTest extends TestCase
{
    public function 
testMockException()
    {
        
$mock $this->createMock('Fooable');
        
$mock->expects($this->once())
            ->
method('connect')
            ->
will($this->throwException(
                new 
Exception('Expected Exception was thrown'))
            );
        
        
$mock->connect();
    }
}

interface 
Fooable
{
    public function 
connect();
}
Result
Time: 299 ms, Memory: 10.00MB

There was 1 error:

1) ExceptionMockTest::testMockException
Expected Exception was thrown

ExceptionMockTest.php:13

ERRORS!
Tests: 1, Assertions: 0, Errors: 1.