/** * testVeryStrangeUseCase method * * @expectedException PDOException * @return void */ public function testVeryStrangeUseCase() { $this->loadFixtures('Article', 'User', 'Tag', 'ArticlesTag'); $Article = new Article(); $query = 'SELECT * FROM ? WHERE ? = ? AND ? = ?'; $param = array($this->db->fullTableName('articles'), $this->db->fullTableName('articles') . '.user_id', '3', $this->db->fullTableName('articles') . '.published', 'Y'); $Article->query($query, $param); }
<?php require_once "../web.config.php"; require_once $realLibPath . "model/article.model.php"; $article = new Article(); $id = $_POST['id']; $dataArray = current($article->query(array("id" => $id), array())); @($currentPage = $_POST['currentPage']); ?> <ol class="am-breadcrumb am-breadcrumb-slash"> <li><a href="#"><strong>文章</strong></a></li> <li><a href="#">编辑</a></li> </ol> <div class="am-form am-form-horizontal"> <div class="am-form-group" style="height:40px"> <label class="am-u-md-2 am-u-md-offset-3 am-form-label am-text-center" >文章标题:</label> <div class="am-u-md-3 am-u-end"> <input type="text" value="<?php echo $dataArray['title']; ?> " id="article_edit_title"/> </div> </div> <div class="am-form-group" style="height:40px"> <label class="am-u-md-2 am-u-md-offset-3 am-form-label am-text-center" >文章类别:</label> <div class="am-u-md-3 am-u-end"> <select name="test" id="article_edit_catID"> <?php foreach ($article->getArtCatInfo() as $item) { ?> <option value="<?php echo $item['code'];
/** * testVeryStrangeUseCase method * * @access public * @return void */ function testVeryStrangeUseCase() { $message = "%s skipping SELECT * FROM ? WHERE ? = ? AND ? = ?; prepared query."; $message .= " MSSQL is incompatible with this test."; if ($this->skipIf($this->db->config['driver'] == 'mssql', $message)) { return; } $this->loadFixtures('Article', 'User', 'Tag', 'ArticlesTag'); $Article = new Article(); $query = 'SELECT * FROM ? WHERE ? = ? AND ? = ?'; $param = array($this->db->fullTableName('articles'), $this->db->fullTableName('articles') . '.user_id', '3', $this->db->fullTableName('articles') . '.published', 'Y'); $this->expectError(); ob_start(); $result = $Article->query($query, $param); ob_end_clean(); }
public function testThatCorrectRootIsSetForNewQuery() { $qb = new QueryBuilder('Article'); $this->assertEquals($qb, Article::query()); $qb = new QueryBuilder('Blog', 'b'); $this->assertEquals($qb, Blog::query(null, 'b')); }