public function testCreateEntity()
 {
     $entity = new Post();
     $query = PostQuery::create();
     $this->assertEquals($entity, $query->createEntity());
 }
Esempio n. 2
0
require_once 'vendor/autoload.php';
require_once 'config.php';
?>

<?php 
if (isset($_POST['submit'])) {
    $post = new Post();
    $post->setUserId($_POST['user-id']);
    $post->setPost($_POST['post']);
    $post->save();
}
?>

<?php 
//Get Posts
$posts = PostQuery::create()->orderById('desc')->find();
//Get Users
$users = UserQuery::create()->find();
?>

<!doctype html>

<html>
    <head>
        <link rel="stylesheet" href="css/bootstrap.css">
        <script src="js/jquery1.11.3.js"></script>
        <script src="js/bootstrap.js"></script>
    </head>

    <body>