浏览代码

Mute E_DEPRECATED warnings during tests and add depreciation warnings to TableSchema

Michael Hoffmann 8 年之前
父节点
当前提交
7228157510
共有 2 个文件被更改,包括 11 次插入0 次删除
  1. 1 0
      phpunit.xml.dist
  2. 10 0
      src/Database/Schema/TableSchema.php

+ 1 - 0
phpunit.xml.dist

@@ -11,6 +11,7 @@
     <php>
         <ini name="memory_limit" value="-1"/>
         <ini name="apc.enable_cli" value="1"/>
+        <ini name="error_reporting" value="E_ALL ~ &amp;E_USER_DEPRECATED"/>
     </php>
 
     <testsuites>

+ 10 - 0
src/Database/Schema/TableSchema.php

@@ -351,6 +351,8 @@ class TableSchema implements TableSchemaInterface, SqlGeneratorInterface
      */
     public function column($name)
     {
+        deprecationWarning('TableSchema::column() is deprecated. Use TableSchema::getColumn() instead.');
+
         return $this->getColumn($name);
     }
 
@@ -379,6 +381,8 @@ class TableSchema implements TableSchemaInterface, SqlGeneratorInterface
      */
     public function columnType($name, $type = null)
     {
+        deprecationWarning('TableSchema::columnType() is deprecated. Use TableSchema::setColumnType() or TableSchema::getColumnType() instead.');
+
         if ($type !== null) {
             $this->setColumnType($name, $type);
         }
@@ -536,6 +540,8 @@ class TableSchema implements TableSchemaInterface, SqlGeneratorInterface
      */
     public function index($name)
     {
+        deprecationWarning('TableSchema::index() is deprecated. Use TableSchema::getIndex() instead.');
+
         return $this->getIndex($name);
     }
 
@@ -689,6 +695,8 @@ class TableSchema implements TableSchemaInterface, SqlGeneratorInterface
      */
     public function constraint($name)
     {
+        deprecationWarning('TableSchema::constraint() is deprecated. Use TableSchema::getConstraint() instead.');
+
         return $this->getConstraint($name);
     }
 
@@ -734,6 +742,8 @@ class TableSchema implements TableSchemaInterface, SqlGeneratorInterface
      */
     public function options($options = null)
     {
+        deprecationWarning('TableSchema::options() is deprecated. Use TableSchema::setOptions() or TableSchema::getOptions() instead.');
+
         if ($options !== null) {
             return $this->setOptions($options);
         }