Kaydet (Commit) bb3eaf5e authored tarafından Ali Yılmaz's avatar Ali Yılmaz 🎯

Mind 3.0.0 sürümüne ait test dosyaları.

üst 40cf8d02
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Mind</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
</projectDescription>
<?php
require_once ('../src/Mind.php');
$Mind = new Mind();
echo '<br>';
if($Mind->columnClear('users', 'username')){
echo 'Sütun temizlendi.';
} else {
echo 'Sütun temizlenemedi.';
}
echo '<br>';
if($Mind->columnClear('users', array('_token', 'created_at'))){
echo 'Sütunlar temizlendi.';
} else {
echo 'Sütunlar temizlenemedi.';
}
\ No newline at end of file
<?php
require_once ('../src/Mind.php');
$Mind = new Mind();
echo '<br>';
$scheme = array(
'username'
);
if($Mind->columnCreate('yenitablo', $scheme)){
echo 'Sütun oluşturuldu.';
} else {
echo 'Sütun oluşturulamadı.';
}
echo '<br>';
$scheme = array(
'created_at',
'updated_at',
'_token'
);
if($Mind->columnCreate('yenitablo', $scheme)){
echo 'Sütunlar oluşturuldu.';
} else {
echo 'Sütunlar oluşturulamadı.';
}
\ No newline at end of file
<?php
require_once ('../src/Mind.php');
$Mind = new Mind();
echo '<br>';
if($Mind->columnDelete('users', 'password')){
echo 'Sütun kaldırıldı.';
} else {
echo 'Sütun kaldırılamadı.';
}
echo '<br>';
if($Mind->columnDelete('users', array('username', 'avatar', '_token'))){
echo 'Sütunlar kaldırıldı.';
} else {
echo 'Sütunlar kaldırılamadı.';
}
\ No newline at end of file
<?php
require_once ('../src/Mind.php');
$Mind = new Mind();
print_r($Mind->columnList('phonebook'));
\ No newline at end of file
<?php
require_once ('../src/Mind.php');
$Mind = new Mind();
echo '<br>';
if($Mind->dbClear('laravel')){
echo 'Veritabanı temizlendi.';
} else {
echo 'Veritabanı temizlenemedi.';
}
echo '<br>';
if($Mind->dbClear(array('ecommerce', 'tutorial', 'weddstore'))){
echo 'Veritabanları temizlendi.';
} else {
echo 'Veritabanları temizlenemedi.';
}
<?php
require_once ('../src/Mind.php');
$Mind = new Mind();
echo '<br>';
if($Mind->dbCreate('weddstore')){
echo 'Veritabanı oluşturuldu.';
} else {
echo 'Veritabanı oluşturulamadı.';
}
echo '<br>';
if($Mind->dbCreate(array('tutorial', 'yilmaz'))){
echo 'Veritabanları oluşturuldu.';
} else {
echo 'Veritabanları oluşturulamadı.';
}
\ No newline at end of file
<?php
require_once ('../src/Mind.php');
$Mind = new Mind();
echo '<br>';
if($Mind->dbDelete('weddstore')){
echo 'Veritabanı kaldırıldı.';
} else {
echo 'Veritabanı kaldırılamadı.';
}
echo '<br>';
if($Mind->dbDelete(array('tutorial', 'yilmaz'))){
echo 'Veritabanları kaldırıldı.';
} else {
echo 'Veritabanları kaldırılamadı.';
}
\ No newline at end of file
<?php
require_once ('../src/Mind.php');
$Mind = new Mind();
print_r($Mind->dbList());
\ No newline at end of file
<?php
require_once('../../src/Mind.php');
$Mind = new Mind();
$options = array(
'column'=>'fakeColumnName'
);
print_r($Mind->getData('users', $options));
/*
*
Array
(
)
*
*
* */
$options = array(
'column'=>'username'
);
print_r($Mind->getData('users', $options));
/*
*
Array
(
[0] => Array
(
[username] => Tilo Mitra
)
[1] => Array
(
[username] => Eric Ferraiuolo
)
[2] => Array
(
[username] => Reid Burke
)
[3] => Array
(
[username] => Andrew Wooldridge
)
)
*
*
* */
$options = array(
'column'=>array('username')
);
print_r($Mind->getData('users', $options));
/*
*
Array
(
[0] => Array
(
[username] => Tilo Mitra
)
[1] => Array
(
[username] => Eric Ferraiuolo
)
[2] => Array
(
[username] => Reid Burke
)
[3] => Array
(
[username] => Andrew Wooldridge
)
)
*
*
* */
$options = array(
'column'=>array('fakeColumnName', 'email', 'password')
);
print_r($Mind->getData('users', $options));
/*
*
Array
(
[0] => Array
(
[email] => tilo.mitra@example.com
[password] => e10adc3949ba59abbe56e057f20f883e
)
[1] => Array
(
[email] => eric.ferraiuolo@example.com
[password] => e10adc3949ba59abbe56e057f20f883e
)
[2] => Array
(
[email] => reid.burke@example.com
[password] => e10adc3949ba59abbe56e057f20f883e
)
[3] => Array
(
[email] => andrew.wooldridge@example.com
[password] => e10adc3949ba59abbe56e057f20f883e
)
)
*
*
* */
\ No newline at end of file
<?php
require_once('../../src/Mind.php');
$Mind = new Mind();
$options = array(
'sort'=>'id:asc',
'limit'=>array(
'start'=>2,
'end'=>1
),
'format'=>'json'
);
echo '<pre>';
print_r($Mind->getData('users', $options));
echo '</pre>';
\ No newline at end of file
<?php
require_once('../../src/Mind.php');
$Mind = new Mind();
echo '<h2>1) Bir veya birçok kelimeyi veritabanı tablosunun tüm sütunlarında aramak (tilo, re)</h2>';
$options = array(
'search'=>array(
'keyword'=>'%tilo%'
)
);
echo '<pre>';
echo '<h3>Sorgu Şeması</h3>';
print_r($options);
echo '<h3>Sorgu Sonucu</h3>';
print_r($Mind->getData('users', $options));
echo '</pre>';
echo '<hr>';
$options = array(
'search'=>array(
'keyword'=>array('%tilo%', '%re%')
)
);
echo '<pre>';
echo '<h3>Sorgu Şeması</h3>';
print_r($options);
echo '<h3>Sorgu Sonucu</h3>';
print_r($Mind->getData('users', $options));
echo '</pre>';
echo '<hr>';
echo '<h2>2) Kelime aramasını veritabanı tablosunun belirtilen sütun veya sütunlarında yapmak (tilo, e10)</h2>';
$options = array(
'search'=>array(
'keyword'=>'%tilo%',
'column'=>'username'
)
);
echo '<pre>';
echo '<h3>Sorgu Şeması</h3>';
print_r($options);
echo '<h3>Sorgu Sonucu</h3>';
print_r($Mind->getData('users', $options));
echo '</pre>';
echo '<hr>';
$options = array(
'search'=>array(
'keyword'=>'%e10%',
'column'=>array(
'username',
'password'
)
)
);
echo '<pre>';
echo '<h3>Sorgu Şeması</h3>';
print_r($options);
echo '<h3>Sorgu Sonucu</h3>';
print_r($Mind->getData('users', $options));
echo '</pre>';
echo '<hr>';
echo '<h2>3) Bir kaydın farklı sütunlarında ki verileri çoklu denklem esasına göre aramak (Eric Ferraiuolo, e10adc3949ba59abbe56e057f20f883e)</h2>';
$options = array(
'search'=>array(
'and'=>array(
'password'=>'e10adc3949ba59abbe56e057f20f883e',
'created_at'=>'03-06-2019 17:22:37'
)
)
);
echo '<pre>';
echo '<h3>Sorgu Şeması</h3>';
print_r($options);
echo '<h3>Sorgu Sonucu</h3>';
print_r($Mind->getData('users', $options));
echo '</pre>';
echo '<hr>';
\ No newline at end of file
<?php
require_once ('../src/Mind.php');
$Mind = new Mind();
echo $Mind->increments('phonebook');
\ No newline at end of file
<?php
require_once ('../src/Mind.php');
$Mind = new Mind();
if($Mind->is_column('phonebook', 'name')){
echo 'true';
} else {
echo 'false';
}
\ No newline at end of file
<?php
require_once ('../src/Mind.php');
$Mind = new Mind();
if($Mind->is_db('mydb')){
echo 'true';
} else {
echo 'false';
}
\ No newline at end of file
<?php
require_once ('../src/Mind.php');
$Mind = new Mind();
if($Mind->is_table('phonebook')){
echo 'true';
} else {
echo 'false';
}
\ No newline at end of file
<?php
require_once ('../src/Mind.php');
$Mind = new Mind();
echo $Mind->newId('phonebook');
\ No newline at end of file
<?php
require_once ('../src/Mind.php');
$Mind = new Mind();
echo '<br>';
if($Mind->tableClear('phonebook')){
echo 'Tablo temizlendi.';
} else {
echo 'Tablo temizlenemedi.';
}
echo '<br>';
if($Mind->tableClear(array('categories', 'users'))){
echo 'Tablolar temizlendi.';
} else {
echo 'Tablolar temizlenemedi.';
}
\ No newline at end of file
<?php
require_once ('../src/Mind.php');
$Mind = new Mind();
$scheme = array(
'id:increments',
'name_surname',
'email_address'
);
if($Mind->tableCreate('yenitablo', $scheme)){
echo 'Tablo oluşturuldu.';
} else {
echo 'Tablo oluşturulamadı.';
}
\ No newline at end of file
<?php
require_once ('../src/Mind.php');
$Mind = new Mind();
echo '<br>';
if($Mind->tableDelete('users')){
echo 'Tablo kaldırıldı.';
} else {
echo 'Tablo kaldırılamadı.';
}
echo '<br>';
if($Mind->tableDelete(array('posts', 'test1'))){
echo 'Tablolar kaldırıldı.';
} else {
echo 'Tablolar kaldırılamadı.';
}
<?php
require_once ('../src/Mind.php');
$Mind = new Mind();
print_r($Mind->tableList('mydb'));
\ No newline at end of file
<?php
require_once ('../src/Mind.php');
$Mind = new Mind();
echo $Mind->timestamp;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment