| @@ 106-134 (lines=29) @@ | ||
| 103 | * @group DBAL-752 |
|
| 104 | * @group DBAL-924 |
|
| 105 | */ |
|
| 106 | public function testGeneratesTypeDeclarationForSmallIntegers() |
|
| 107 | { |
|
| 108 | self::assertEquals( |
|
| 109 | 'SMALLINT', |
|
| 110 | $this->_platform->getSmallIntTypeDeclarationSQL(array()) |
|
| 111 | ); |
|
| 112 | self::assertEquals( |
|
| 113 | 'INTEGER', |
|
| 114 | $this->_platform->getSmallIntTypeDeclarationSQL(array('autoincrement' => true)) |
|
| 115 | ); |
|
| 116 | self::assertEquals( |
|
| 117 | 'INTEGER', |
|
| 118 | $this->_platform->getTinyIntTypeDeclarationSQL(array('autoincrement' => true, 'unsigned' => true)) |
|
| 119 | ); |
|
| 120 | self::assertEquals( |
|
| 121 | 'INTEGER', |
|
| 122 | $this->_platform->getSmallIntTypeDeclarationSQL( |
|
| 123 | array('autoincrement' => true, 'primary' => true) |
|
| 124 | ) |
|
| 125 | ); |
|
| 126 | self::assertEquals( |
|
| 127 | 'SMALLINT', |
|
| 128 | $this->_platform->getSmallIntTypeDeclarationSQL(array('unsigned' => false)) |
|
| 129 | ); |
|
| 130 | self::assertEquals( |
|
| 131 | 'SMALLINT UNSIGNED', |
|
| 132 | $this->_platform->getSmallIntTypeDeclarationSQL(array('unsigned' => true)) |
|
| 133 | ); |
|
| 134 | } |
|
| 135 | ||
| 136 | /** |
|
| 137 | * @group DBAL-752 |
|
| @@ 140-168 (lines=29) @@ | ||
| 137 | * @group DBAL-752 |
|
| 138 | * @group DBAL-924 |
|
| 139 | */ |
|
| 140 | public function testGeneratesTypeDeclarationForMediumIntegers() |
|
| 141 | { |
|
| 142 | self::assertEquals( |
|
| 143 | 'MEDIUMINT', |
|
| 144 | $this->_platform->getMediumIntTypeDeclarationSQL(array()) |
|
| 145 | ); |
|
| 146 | self::assertEquals( |
|
| 147 | 'INTEGER', |
|
| 148 | $this->_platform->getMediumIntTypeDeclarationSQL(array('autoincrement' => true)) |
|
| 149 | ); |
|
| 150 | self::assertEquals( |
|
| 151 | 'INTEGER', |
|
| 152 | $this->_platform->getMediumIntTypeDeclarationSQL(array('autoincrement' => true, 'unsigned' => true)) |
|
| 153 | ); |
|
| 154 | self::assertEquals( |
|
| 155 | 'INTEGER', |
|
| 156 | $this->_platform->getMediumIntTypeDeclarationSQL( |
|
| 157 | array('autoincrement' => true, 'primary' => true) |
|
| 158 | ) |
|
| 159 | ); |
|
| 160 | self::assertEquals( |
|
| 161 | 'MEDIUMINT', |
|
| 162 | $this->_platform->getMediumIntTypeDeclarationSQL(array('unsigned' => false)) |
|
| 163 | ); |
|
| 164 | self::assertEquals( |
|
| 165 | 'MEDIUMINT UNSIGNED', |
|
| 166 | $this->_platform->getMediumIntTypeDeclarationSQL(array('unsigned' => true)) |
|
| 167 | ); |
|
| 168 | } |
|
| 169 | ||
| 170 | public function testGeneratesTypeDeclarationForIntegers() |
|
| 171 | { |
|
| @@ 170-198 (lines=29) @@ | ||
| 167 | ); |
|
| 168 | } |
|
| 169 | ||
| 170 | public function testGeneratesTypeDeclarationForIntegers() |
|
| 171 | { |
|
| 172 | self::assertEquals( |
|
| 173 | 'INTEGER', |
|
| 174 | $this->_platform->getIntegerTypeDeclarationSQL(array()) |
|
| 175 | ); |
|
| 176 | self::assertEquals( |
|
| 177 | 'INTEGER', |
|
| 178 | $this->_platform->getIntegerTypeDeclarationSQL(array('autoincrement' => true)) |
|
| 179 | ); |
|
| 180 | self::assertEquals( |
|
| 181 | 'INTEGER', |
|
| 182 | $this->_platform->getIntegerTypeDeclarationSQL(array('autoincrement' => true, 'unsigned' => true)) |
|
| 183 | ); |
|
| 184 | self::assertEquals( |
|
| 185 | 'INTEGER', |
|
| 186 | $this->_platform->getIntegerTypeDeclarationSQL( |
|
| 187 | array('autoincrement' => true, 'primary' => true) |
|
| 188 | ) |
|
| 189 | ); |
|
| 190 | self::assertEquals( |
|
| 191 | 'INTEGER', |
|
| 192 | $this->_platform->getIntegerTypeDeclarationSQL(array('unsigned' => false)) |
|
| 193 | ); |
|
| 194 | self::assertEquals( |
|
| 195 | 'INTEGER UNSIGNED', |
|
| 196 | $this->_platform->getIntegerTypeDeclarationSQL(array('unsigned' => true)) |
|
| 197 | ); |
|
| 198 | } |
|
| 199 | ||
| 200 | /** |
|
| 201 | * @group DBAL-752 |
|
| @@ 204-232 (lines=29) @@ | ||
| 201 | * @group DBAL-752 |
|
| 202 | * @group DBAL-924 |
|
| 203 | */ |
|
| 204 | public function testGeneratesTypeDeclarationForBigIntegers() |
|
| 205 | { |
|
| 206 | self::assertEquals( |
|
| 207 | 'BIGINT', |
|
| 208 | $this->_platform->getBigIntTypeDeclarationSQL(array()) |
|
| 209 | ); |
|
| 210 | self::assertEquals( |
|
| 211 | 'INTEGER', |
|
| 212 | $this->_platform->getBigIntTypeDeclarationSQL(array('autoincrement' => true)) |
|
| 213 | ); |
|
| 214 | self::assertEquals( |
|
| 215 | 'INTEGER', |
|
| 216 | $this->_platform->getBigIntTypeDeclarationSQL(array('autoincrement' => true, 'unsigned' => true)) |
|
| 217 | ); |
|
| 218 | self::assertEquals( |
|
| 219 | 'INTEGER', |
|
| 220 | $this->_platform->getBigIntTypeDeclarationSQL( |
|
| 221 | array('autoincrement' => true, 'primary' => true) |
|
| 222 | ) |
|
| 223 | ); |
|
| 224 | self::assertEquals( |
|
| 225 | 'BIGINT', |
|
| 226 | $this->_platform->getBigIntTypeDeclarationSQL(array('unsigned' => false)) |
|
| 227 | ); |
|
| 228 | self::assertEquals( |
|
| 229 | 'BIGINT UNSIGNED', |
|
| 230 | $this->_platform->getBigIntTypeDeclarationSQL(array('unsigned' => true)) |
|
| 231 | ); |
|
| 232 | } |
|
| 233 | ||
| 234 | public function testGeneratesTypeDeclarationForStrings() |
|
| 235 | { |
|