/** * @covers WindowsAzure\Common\Internal\Utilities::arrayKeyExistsIgnoreCase */ public function testArrayKeyExistsIgnoreCase() { // Setup $expected = true; $testKey = 'VaLuE'; $testArray = array('NamE' => 1, 'VALUe' => 20, '12M3' => 0); // Test $actual = Utilities::arrayKeyExistsIgnoreCase($testKey, $testArray); // Assert $this->assertEquals($expected, $actual); }
/** * @covers WindowsAzure\Blob\BlobRestProxy::createPageBlob * @covers WindowsAzure\Blob\BlobRestProxy::getBlobProperties * @covers WindowsAzure\Blob\BlobRestProxy::setBlobMetadata */ public function testSetBlobMetadataWorks() { // Act $container = self::$_test_container_for_blobs; $blob = 'test11'; $metadata = array('test' => 'bar', 'blah' => 'bleah'); $this->restProxy->createPageBlob($container, $blob, 4096); $result = $this->restProxy->setBlobMetadata($container, $blob, $metadata); $props = $this->restProxy->getBlobProperties($container, $blob); // Assert $this->assertNotNull($result, '$result'); $this->assertNotNull($result->getEtag(), '$result->getEtag()'); $this->assertNotNull($result->getLastModified(), '$result->getLastModified()'); $this->assertNotNull($props, '$props'); $this->assertNotNull($props->getMetadata(), '$props->getMetadata()'); $this->assertEquals(2, count($props->getMetadata()), 'count($props->getMetadata())'); $this->assertTrue(Utilities::arrayKeyExistsIgnoreCase('test', $props->getMetadata()), 'Utilities::arrayKeyExistsIgnoreCase(\'test\', $props->getMetadata())'); $this->assertTrue(!(array_search('bar', $props->getMetadata()) === FALSE), '!(array_search(\'bar\', $props->getMetadata()) === FALSE)'); $this->assertTrue(Utilities::arrayKeyExistsIgnoreCase('blah', $props->getMetadata()), 'Utilities::arrayKeyExistsIgnoreCase(\'blah\', $props->getMetadata())'); $this->assertTrue(!(array_search('bleah', $props->getMetadata()) === FALSE), '!(array_search(\'bleah\', $props->getMetadata()) === FALSE)'); }