CC-2166: Packaging Improvements. Moved the Zend app into airtime_mvc. It is now installed to /var/www/airtime. Storage is now set to /srv/airtime/stor. Utils are now installed to /usr/lib/airtime/utils/. Added install/airtime-dircheck.php as a simple test to see if everything is install/uninstalled correctly.
This commit is contained in:
parent
514777e8d2
commit
b11cbd8159
4546 changed files with 138 additions and 51 deletions
|
@ -0,0 +1,94 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Propel package.
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
* @license MIT License
|
||||
*/
|
||||
|
||||
require_once 'tools/helpers/bookstore/BookstoreTestBase.php';
|
||||
|
||||
/**
|
||||
* Tests the exceptions thrown by the BasePeer classes.
|
||||
*
|
||||
* @see BookstoreDataPopulator
|
||||
* @author Francois Zaninotto
|
||||
* @package runtime.util
|
||||
*/
|
||||
class BasePeerExceptionsTest extends BookstoreTestBase
|
||||
{
|
||||
|
||||
public function testDoSelect()
|
||||
{
|
||||
try {
|
||||
$c = new Criteria();
|
||||
$c->add(BookPeer::ID, 12, ' BAD SQL');
|
||||
BookPeer::addSelectColumns($c);
|
||||
BasePeer::doSelect($c);
|
||||
} catch (PropelException $e) {
|
||||
$this->assertContains('[SELECT book.ID, book.TITLE, book.ISBN, book.PRICE, book.PUBLISHER_ID, book.AUTHOR_ID FROM `book` WHERE book.ID BAD SQL:p1]', $e->getMessage(), 'SQL query is written in the exception message');
|
||||
}
|
||||
}
|
||||
|
||||
public function testDoCount()
|
||||
{
|
||||
try {
|
||||
$c = new Criteria();
|
||||
$c->add(BookPeer::ID, 12, ' BAD SQL');
|
||||
BookPeer::addSelectColumns($c);
|
||||
BasePeer::doCount($c);
|
||||
} catch (PropelException $e) {
|
||||
$this->assertContains('[SELECT COUNT(*) FROM `book` WHERE book.ID BAD SQL:p1]', $e->getMessage(), 'SQL query is written in the exception message');
|
||||
}
|
||||
}
|
||||
|
||||
public function testDoDelete()
|
||||
{
|
||||
try {
|
||||
$c = new Criteria();
|
||||
$c->setPrimaryTableName(BookPeer::TABLE_NAME);
|
||||
$c->add(BookPeer::ID, 12, ' BAD SQL');
|
||||
BasePeer::doDelete($c, Propel::getConnection());
|
||||
} catch (PropelException $e) {
|
||||
$this->assertContains('[DELETE FROM `book` WHERE book.ID BAD SQL:p1]', $e->getMessage(), 'SQL query is written in the exception message');
|
||||
}
|
||||
}
|
||||
|
||||
public function testDoDeleteAll()
|
||||
{
|
||||
try {
|
||||
BasePeer::doDeleteAll('BAD TABLE', Propel::getConnection());
|
||||
} catch (PropelException $e) {
|
||||
$this->assertContains('[DELETE FROM `BAD` `TABLE`]', $e->getMessage(), 'SQL query is written in the exception message');
|
||||
}
|
||||
}
|
||||
|
||||
public function testDoUpdate()
|
||||
{
|
||||
try {
|
||||
$c1 = new Criteria();
|
||||
$c1->setPrimaryTableName(BookPeer::TABLE_NAME);
|
||||
$c1->add(BookPeer::ID, 12, ' BAD SQL');
|
||||
$c2 = new Criteria();
|
||||
$c2->add(BookPeer::TITLE, 'Foo');
|
||||
BasePeer::doUpdate($c1, $c2, Propel::getConnection());
|
||||
} catch (PropelException $e) {
|
||||
$this->assertContains('[UPDATE `book` SET `TITLE`=:p1 WHERE book.ID BAD SQL:p2]', $e->getMessage(), 'SQL query is written in the exception message');
|
||||
}
|
||||
}
|
||||
|
||||
public function testDoInsert()
|
||||
{
|
||||
try {
|
||||
$c = new Criteria();
|
||||
$c->setPrimaryTableName(BookPeer::TABLE_NAME);
|
||||
$c->add(BookPeer::AUTHOR_ID, 'lkhlkhj');
|
||||
BasePeer::doInsert($c, Propel::getConnection());
|
||||
} catch (PropelException $e) {
|
||||
$this->assertContains('[INSERT INTO `book` (`AUTHOR_ID`) VALUES (:p1)]', $e->getMessage(), 'SQL query is written in the exception message');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue