Scalr\Tests\Service\Aws\ElbTest::testCreateLoadBalancerTheSameName PHP Method

testCreateLoadBalancerTheSameName() public method

    public function testCreateLoadBalancerTheSameName()
    {
        $this->skipIfEc2PlatformDisabled();
        $exception = null;
        $repo = $this->elb->getEntityManager()->getRepository('Elb:LoadBalancerDescription');
        $lb2 = $repo->find(self::getTestName(self::LB_NAME_FUNC_TEST_2));
        $this->assertInstanceOf(self::CLASS_LOAD_BALANCER_DESCRIPTION_DATA, $lb2);
        try {
            $dnsName = $this->elb->loadBalancer->create(self::getTestName(self::LB_NAME_FUNC_TEST_2), array(array('loadBalancerPort' => 1026, 'instancePort' => 1026, 'protocol' => 'HTTP', 'sslCertificateId' => null)), array(AwsTestCase::AVAILABILITY_ZONE_D));
            $this->assertTrue(false, 'QueryClientException must be thrown here.');
        } catch (QueryClientException $exception) {
            $this->assertInstanceOf(self::CLASS_ERROR_DATA, $exception->getErrorData());
            $this->assertEquals(ErrorData::ERR_DUPLICATE_LOAD_BALANCER_NAME, $exception->getErrorData()->getCode());
        }
    }