26 Aralık 2009 Cumartesi

ADVTemplate Class Test

ADVTemplate sınıfımızın test edilmesini sağlamak ve değerlerin bir listesini görmek amaçlı bir kod parçası hazırladım. Bu kod, hem temamızın yaratılması sırasında hem de yaratıldıktan sonraki zamanlarda veri değişikliği yaparak sonçları gösteriyor.
Test kodumuz şu şekilde;
/**
 * This is the tester file of the ADVTemplate class.
 * 
 * @author Behçet MUTLU
 * @copyright 2009 Adres Gezgini
 */

include_once("../system.core.php");

$adv = new ADVTemplate("template-1.xml", array("image1"=>"image1.png", "image2"=>"test2.png"));

$adv->setValueOf("image1","test1.png");
echo "< pre>";
$adv->toString();
echo "< /pre>"; 
Test kodumuzun sonuçlanmış olduğu ekran çıktısı da şöyle;
DEBUG:  XML file, "template-1.xml" loaded successfully.

ADVTemplate Object
(
    [name:ADVTemplate:private] => Template 1
    [author:ADVTemplate:private] => Behçet MUTLU
    [datecreated:ADVTemplate:private] => 25-12-2009
    [copyright:ADVTemplate:private] => 2009 Adres Gezgini
    [website:ADVTemplate:private] => www.adresgezgini.com.tr
    [schema:ADVTemplate:private] => template-1.xml
    [isReady:ADVTemplate:private] => 1
    [xml:ADVTemplate:private] => Array
        (
            [template] => Array
                (
                    [0] => 

                    [info] => Array
                        (
                            [0] => 
    
                            [name] => Template 1
                            [author] => Behçet MUTLU
                            [copyright] => 2009 Adres Gezgini
                            [website] => www.adresgezgini.com.tr
                            [datecreated] => 25-12-2009
                        )

                    [fields] => Array
                        (
                            [0] => 
    
                            [image] => Array
                                (
                                    [0] => Array
                                        (
                                            [0] => 
        
                                            [title] => Logo Resmi
                                            [description] => Eklemek istediğiniz logo resmini dosyadan seçiniz.
                                            [default] => library/image_64x64.png
                                            [@id] => image1
                                            [@width] => 64
                                            [@height] => 64
                                        )

                                    [1] => Array
                                        (
                                            [0] => 
        
                                            [title] => Ürün Resmi
                                            [description] => Eklemek istediğiniz ürün resmini dosyadan seçiniz.
                                            [default] => library/image_128x169.png
                                            [@id] => image2
                                            [@width] => 128
                                            [@height] => 169
                                        )

                                )

                            [text] => Array
                                (
                                    [0] => Array
                                        (
                                            [0] => 
        
                                            [title] => Başlık Yazısı
                                            [description] => Eklemek istediğiniz başlık yazısını belirtiniz.
                                            [default] => Başlık Yazısı
                                            [font] => Arial
                                            [color] => 000000
                                            [size] => 20
                                            [@id] => text1
                                            [@max] => 100
                                            [@min] => 10
                                        )

                                    [1] => Array
                                        (
                                            [0] => 
        
                                            [title] => Web Site Adresi
                                            [description] => Eklemek istediğiniz web site adresinizi belirtiniz.
                                            [default] => www.websiteniz.com.tr
                                            [font] => Arial
                                            [color] => 000000
                                            [size] => 12
                                            [@id] => text2
                                            [@max] => 100
                                            [@min] => 10
                                        )

                                    [2] => Array
                                        (
                                            [0] => 
        
                                            [title] => Buton Yazısı
                                            [description] => Eklemek istediğiniz buton yazısını belirtiniz.
                                            [default] => Bilgi İçin Tıklayınız
                                            [font] => Impact
                                            [color] => 000000
                                            [size] => 18
                                            [@id] => text3
                                            [@max] => 100
                                            [@min] => 10
                                        )

                                )

                        )

                )

        )

    [fields:ADVTemplate:private] => Array
        (
            [0] => 
    
            [image] => Array
                (
                    [0] => Array
                        (
                            [0] => 
        
                            [title] => Logo Resmi
                            [description] => Eklemek istediğiniz logo resmini dosyadan seçiniz.
                            [default] => library/image_64x64.png
                            [@id] => image1
                            [@width] => 64
                            [@height] => 64
                        )

                    [1] => Array
                        (
                            [0] => 
        
                            [title] => Ürün Resmi
                            [description] => Eklemek istediğiniz ürün resmini dosyadan seçiniz.
                            [default] => library/image_128x169.png
                            [@id] => image2
                            [@width] => 128
                            [@height] => 169
                        )

                )

            [text] => Array
                (
                    [0] => Array
                        (
                            [0] => 
        
                            [title] => Başlık Yazısı
                            [description] => Eklemek istediğiniz başlık yazısını belirtiniz.
                            [default] => Başlık Yazısı
                            [font] => Arial
                            [color] => 000000
                            [size] => 20
                            [@id] => text1
                            [@max] => 100
                            [@min] => 10
                        )

                    [1] => Array
                        (
                            [0] => 
        
                            [title] => Web Site Adresi
                            [description] => Eklemek istediğiniz web site adresinizi belirtiniz.
                            [default] => www.websiteniz.com.tr
                            [font] => Arial
                            [color] => 000000
                            [size] => 12
                            [@id] => text2
                            [@max] => 100
                            [@min] => 10
                        )

                    [2] => Array
                        (
                            [0] => 
        
                            [title] => Buton Yazısı
                            [description] => Eklemek istediğiniz buton yazısını belirtiniz.
                            [default] => Bilgi İçin Tıklayınız
                            [font] => Impact
                            [color] => 000000
                            [size] => 18
                            [@id] => text3
                            [@max] => 100
                            [@min] => 10
                        )

                )

        )

    [values:ADVTemplate:private] => Array
        (
            [image1] => test.png
            [image2] => test2.png
            [text1] => Başlık Yazısı
            [text2] => www.websiteniz.com.tr
            [text3] => Bilgi İçin Tıklayınız
        )

)

0 yorum:

Yorum Gönder